trend models - university of wisconsin–madisonbhansen/390/2010/390lecture6.pdf · trend models...

66
Trend Models A trend model is where Time t is the time index. In STATA, Time t is an integer sequence, normalized to be zero at first observation of 1960. Most common models Linear Trend Exponential Trend Quadratic Trend Trends with Changing SLope ) ( t t Time g T =

Upload: others

Post on 05-Apr-2020

10 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Trend Models

• A trend model is

where  Timet is the time index.• In STATA, Timet is an integer sequence, normalized to be zero at first observation of 1960.

• Most common models– Linear Trend– Exponential Trend– Quadratic Trend– Trends with Changing SLope

)( tt TimegT =

Page 2: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Warning:Be skeptical of Trend Models

• While in some cases, trend forecasting can be useful.

• In many cases, it can be hazardous.

• We will examine some of the trend examples in Chapter 5 of Diebold’s text

• They did not forecast well out of sample.

• A constructive alternative is to forecast growth rates, as we did for consumption expenditure.

Page 3: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Example 1Labor Force Participation Rate

• From BLS

• Monthly, 1948‐2009, Seasonally adjusted

• Men and Women, ages 25+

• Percentage of population in labor force (employed plus unemployed divided by population)

• Diebold estimates on 1948‐1992

• We will estimate on 1948‐1992, forecast 1993‐2009

Page 4: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Women’s Labor Participation Rate1948‐1992

Page 5: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Men’s Labor Participation Rate1948‐1992

Page 6: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Linear Trend Model

• The labor force participation rates have been smoothly and linearly increasing (for women) and smoothly and linearly decreasing (for men) over 1948‐1992

• This suggests a linear trend

• In this model, β1 is the expected period‐to‐period change in the trend Tt

tt TimeT 10 ββ +=

Page 7: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Example 2Retail Sales, Current Dollars

• From Census Bureau

• Monthly, 1955‐2001, seasonally adjusted– This particular series discontinued after 2001

• Diebold estimates up to 1991

• We will forecast 1992‐current

Page 8: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Retail Sales1955‐1993

Page 9: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Quadratic Trends

• The retail sales series has been increasing smoothly over 1955‐1993, but not linearly.

• To model this we will use a quadratic trend2

210 ttt TimeTimeT βββ ++=

Page 10: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Example 3Transaction Volume, S&P Index

• From Yahoo Finance

• (Similar to NYSE series in Diebold)

• Weekly, 1950‐current

• Diebold estimates on 1955‐1993, forecasts 1994

• We will forecast 1994‐2001

Page 11: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Transaction Volume

Page 12: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Exponential Trend

• To model this we will use an exponential trend

• The exponential trend is linear after taking (natural) logarithms

• This is typically estimated by a linear model after taking logs of the variable to forecast 

tTimet eT 10 ββ +=

( ) tt TimeT 10ln ββ +=

Page 13: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Ln(Volume)

• In logarithms, trend is roughly linear.

Page 14: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Exponential Trends

• Most economic series which are growing (aggregate output, such as GDP, investment, consumption) are exponentially increasing– Percentage changes are stable in the long run

• These series cannot be fit by a linear trend

• We can fit a linear trend to their (natural) logarithm

Page 15: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Linear Models

• The linear and quadratic trends are both linear regression models of the form

or

where– x1t = Timet– x2t = Timet2

ttt xx 22110 βββμ ++=

tt x110 ββμ +=

Page 16: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Example 4Real GDP

• From BEA

• Quarterly, 1947‐2009

• We will estimate on 1947‐1990, forecast 1991‐2009

• Also use an exponential trend

Page 17: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Real GDP

Page 18: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Ln(Real GDP)

Page 19: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Linear Forecasting

• The goal is to forecast future observations given a linear function of observables

• In the case of trend estimation, these observables are functions of the time index

• In other cases, they will be other functions of the data

• In the model the forecast for  yt+h is  ŷt+h=b0+b1xt  where  b0and  b1 are estimates

tt x10 ββμ +=

Page 20: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Estimation

• How should we select  b0 and  b1 ?• The goal is to produce a forecast with low mean square error (MSE)

• The best linear forecast is the linear function  β0+β1xt  that minimizes the MSE

• We do not know the MSE, but we can estimate it by a sample average

( ) ( )2102ˆ thththt xyEyyE ββ −−=− +++

Page 21: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Sum of Squared Errors

• Sample estimate of mean square error is the sum of squared errors

• The best linear forecast is the linear function  β0+β1xt  that minimizes the MSE, or expected sum of squared errors.

• Our sample estimate of the best linear forecast is the linear function which minimizes the (sample) sum of squared errors.

• This is called the least‐squares estimator

( ) ( )∑=

+ −−=n

tthtn xy

nS

1

21010

1, ββββ

Page 22: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Least Squares

• The least‐squares estimates (b0,b1) are the values which minimize the sum of squared errors

• This produces estimates of the best linear predictor – the linear function  β0+β1xt  that minimizes the MSE

( ) ( )∑=

+ −−=n

tthtn xy

nS

1

21010

1, ββββ

Page 23: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Multiple Regressors

• There are multiple regressors

• For example, the quadratic trend

• The best linear predictor is the linear function  β0+β1x1t+β2x2t  that minimizes the MSE

2210 ttt TimeTimeT βββ ++=

ttt xx 22110 βββμ ++=

( ) ( )2221102ˆ tthththt xxyEyyE βββ −−−=− +++

Page 24: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Multiple Regression

• The sample estimate of the best linear predictor are the values (b0,b1,b2) which minimize the sum of squared errors

• In STATA, use the regress command

( ) ( )∑=

+ −−−=n

ttthtn xxy

nS

1

222110210

1,, ββββββ

Page 25: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Example 1Women’s Labor Force Participation Rate

Page 26: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Regression Estimation

Page 27: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

In‐Sample Fit

Page 28: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Residuals

• Residuals are difference between data and fitted regression line

tht

thtt

TimebbyTye

10

ˆ−−=

−=

+

+

Page 29: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Residual Plot

Page 30: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

In‐Sample Fit

• Compute with predict command• Fit looks good

Page 31: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Forecast

• Forecast is the linear function with estimated coefficients

• Compute with predict command

hThT TimebbT ++ += 10

Page 32: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Forecast Intervals

• Compute residuals

• Compute quantiles of residuals– These are constant over time

• Add to predicted values– Identical to constant mean case

tht

thtt

Timebbyye

10

ˆˆ−−=

−=

+

+ μ

Page 33: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Out‐of‐Sample Forecast

• Out of sample prediction might be too low.

Page 34: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Out‐of‐SampleWomen’s Labor Force Participation

• No: Prediction was way too high!

Page 35: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Men’s Labor Force Participation Rate

Page 36: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Estimation

Page 37: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

In‐Sample Fit

Page 38: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Residuals

Page 39: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Forecast

• End of Sample looks worrying

Page 40: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Out‐of‐SampleMen’s Labor Force Participation

• Linear Trend Terrible

Page 41: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Example 2Retail Sales

Page 42: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Linear and Quadratic Trend

Page 43: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Linear and Quadratic Trend

Page 44: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Forecast

Page 45: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Residuals

Page 46: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Actual Values

Page 47: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Example 3: Volume

Page 48: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Estimating Logarithmic Trend

Page 49: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Fitted Trend

Page 50: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Residuals

Page 51: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Forecast

Page 52: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Out‐of‐Sample

Page 53: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

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 54: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Forecast in Levels

Page 55: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Out‐of‐Sample

Page 56: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Example 4: Real GDP

Page 57: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Ln(Real GDP)

Page 58: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Estimation

Page 59: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Fitted Trend

Page 60: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Residuals

Page 61: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Forecast of ln(RGDP)

Page 62: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Forecast of RGDP (in levels)

Page 63: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Out‐of‐Sample

Page 64: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

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 65: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

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 66: Trend Models - University of Wisconsin–Madisonbhansen/390/2010/390Lecture6.pdf · Trend Models • A trend model is where Time t. is the time index. • In STATA, Time. t. is an

Final Trend ForecastWorld Record – 100 meter sprint