0 1 t b btime t h - university of wisconsin–madisonbhansen/390/390lecture6.pdf · • suppose the...

53
Forecast Forecast is the linear function with estimated coefficients Compute with predict command h T h T Time b b T + + + = 1 0

Upload: others

Post on 02-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Forecast

• Forecast is the linear function with estimated coefficients

• Compute with predict command

hThT TimebbT ++ += 10

Page 2: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Forecast Intervals

• Compute residuals

• Compute standard deviation of forecast– These are constant over time

• Add to predicted values– Identical to constant mean case

tht

hthtt

Timebbyyye

10

ˆˆ−−=

−=

+

++

Page 3: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Out‐of‐Sample Forecast

• Out of sample prediction might be too low.

Page 4: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Out‐of‐SampleWomen’s Labor Force Participation

• No: Prediction was way too high!

Page 5: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Men’s Labor Force Participation Rate

Page 6: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Estimation

Page 7: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

In‐Sample Fit

Page 8: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Residuals

Page 9: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Forecast

• End of Sample looks worrying

Page 10: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Out‐of‐SampleMen’s Labor Force Participation

• Linear Trend Terrible

Page 11: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Example 2Retail Sales

Page 12: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Linear and Quadratic Trend

Page 13: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Linear and Quadratic Trend

Page 14: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Forecast

Page 15: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Residuals

Page 16: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Actual Values

Page 17: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Example 3: Volume

Page 18: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Estimating Logarithmic Trend

Page 19: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Fitted Trend

Page 20: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Residuals

Page 21: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Forecast

Page 22: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Out‐of‐Sample

Page 23: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Forecasting Levels from a Forecast of Logs

• Let  Yt be a series and yt=ln(Yt) its logarithm• Suppose the forecast for the log is a linear trend:  E(yt+h | Ωt) = Tt = β0+ β1 Timet

• Then a forecast for  Yt is  exp(Tt)• If [LT , UT] is a forecast interval for  yT+h• Then [exp(LT) , exp(UT)]  is a forecast interval for YT+h

• In other words, just take your point and interval forecasts, and apply the exponential function.– In STATA, use generate command

Page 24: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Forecast in Levels

Page 25: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Out‐of‐Sample

Page 26: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Example 4: Real GDP

Page 27: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Ln(Real GDP)

Page 28: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Estimation

Page 29: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Fitted Trend

Page 30: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Residuals

Page 31: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Forecast of ln(RGDP)

Page 32: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Forecast of RGDP (in levels)

Page 33: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Out‐of‐Sample

Page 34: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Problems with Pure Trend Forecasts

• Trend forecasts understate uncertainty• Actual uncertainty increases at long forecast horizons.

• Short‐term trend forecasts can be quite poor unless trend lined up correctly

• Long‐term trend forecasts are typically quite poor, as trends change over long time periods

• It is preferred to work with growth rates, and reconstruct levels from forecasted growth rates (more on this later).

Page 35: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Trend Models

• I hope I’ve convinced you to be skeptical of trend‐based forecasting.

• The problem is that there is no economic theory for constant trends, and “changes” in the trend function are not apparent before they occur.

• It is better to forecast growth rates, and build levels from growth.

Page 36: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Final Trend ForecastWorld Record – 100 meter sprint

Page 37: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Changing Trends

• We have seen in some cases that it appears that the trend slope has changed at some point.

• This is a type of structural change, sometimes called a changing trend or breaking trend.

• We can model this using the interaction of dummy variables with the trend.

Page 38: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Labor Force Participation ‐Men

• Separate trends fit to 1950‐1982 and 1983‐1992

Page 39: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Sub‐Sample Trend Lines

• If you fit a trend for observations before and after a breakdate τ, then for  t≤τ

and for t>τ

• Notice that both the intercept and slope change

tt TimeT 10 ββ +=

tt TimeT 10 αα +=

Page 40: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Estimation

• You can simply estimate on each sub‐sample separately, and then forecast using the second set of estimates.

• Or, you can use dummy variable interactions.

• Define the dummy variable for observations after time  τ

( )τ≥= tdt 1

Page 41: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Dummy Equation

where 

• This is a linear regression, with regressorsTimet,  dt and  Timetdt

( ) ( ) ( ) ( )( ) ( ) ( )( ) ( )

tttt

tt

ttt

dTimedTimetTimeTime

tTimetTimeT

3210

110010

1010

111

ββββτβαβαββ

ταατββ

+++=≥−+−++=

≥++<+=

113

002

βαββαβ

−=−=

Page 42: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Estimation

Page 43: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Fitted

Page 44: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Discontinuity

• One problem with this method is that the estimated trend function can be discontinuous– At the breakdate τ there might be a jump in the trend function

– This might not be sensible– We may wish to impose continuity

• In the model, this requires

or

ταατββ 1010 +=+

032 =+ τββ

Page 45: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Continuous Break

• You can impose a continuous trend by using a technique known as a spline

where

• The variable  Timet* is 0 before the breakdate, and is a smoothly increasing trend afterwards.

( ) ( )*

210

210 1

tt

ttt

TimeTime

tTimeTimeT

βββ

ττβββ

++=

≥−++=

( ) ( )ττ ≥−= tTimeTime tt 1*

Page 46: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Fitted Continuous Trend

Page 47: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Continuous Trend Forecast

Page 48: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Contrast with Linear Trend Forecast

Page 49: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Real GDP

• Break in 1974q1

Page 50: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Real GDP ‐ fitted

Page 51: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Forecast – Breaking Trend Model

Page 52: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

Contrast – Forecast from Linear Trend

Page 53: 0 1 T b bTime T h - University of Wisconsin–Madisonbhansen/390/390Lecture6.pdf · • Suppose the forecast for the log is a linear trend: E(y t+h | Ω t) = T t = β 0 + β 1 Time

How to pick Breaks/Breakdates

• With caution, and skeptically

• Always have plenty of data (at least 10 years) after the breakdate

• Look for economic explanations

• Formally, the breakdate can be selected by minimizing the sum of squared errors