Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While...

45
Estimation Uncertainty The sample mean is an estimate of β 0 = E(y t+h ) The estimation error is = + = T t h t y T b 1 0 1 ( ) = = + = + = = = T t t T t h t T t h t e T y T y T b 1 1 0 0 1 0 0 1 1 1 β β β

Transcript of Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While...

Page 1: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Estimation Uncertainty

• The sample mean

is an estimate of  β0 = E(yt+h)

• The estimation error is

∑=

+=T

thty

Tb

10

1

( )

=

=+

=+

=

−=

−=−

T

tt

T

tht

T

tht

eT

yT

yT

b

1

10

01

00

1

1

1

β

ββ

Page 2: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Estimation Variance

• Under classical conditions, 

where  σ2=var(et)

• The standard error for b0 is an estimate of the standard deviation

( )T

b2

0var σ=

( )T

bsd2

0σ̂

=

Page 3: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Forecast Variance

• When the sample mean  b0 is used as the forecast for  yT+h then the prediction error is

which is the sum of the forecast error  eT+h and the estimation uncertainty β0‐b0. 

• The forecast variance is

000 beby hThT −+=− ++ β

( ) ( ) ( )

2

22

000

11

varvarvar

σ

σσ

β

⎟⎠⎞

⎜⎝⎛ +=

+=

−+=− ++

T

T

beby hThT

Page 4: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Standard Deviation of Forecast 

• The standard deviation of the forecast is the estimate

• This is slightly larger than the regression standard deviation

• Calculated in STATA after a regression using the stdf option to the predict command:

• predict s, stdf• This creates variable “s”

2ˆ11 σ⎟⎠⎞

⎜⎝⎛ +=+ T

s hT

σ̂

Page 5: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Normal Forecast Intervals

• Let ŷT+h be a forecast for yT+h• The prediction error is  yT+h‐ ŷT+h• Let  sT+hbe the st. deviation of the forecast • If the prediction errors are normally distributed, the (1‐α)% forecast interval endpoints are

where zα/2 and z1‐α/2 are the α/2 and 1‐α /2 quantiles of the normal distribution 

• e.g. ŷT+h±1.64 sT+h for a 90% interval

2/1

2/

ˆˆ

α

α

−+++

+++

+=+=

zsyUzsyL

hThThT

hThThT

Page 6: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.
Page 7: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Out‐of‐Sample

Page 8: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Out‐of‐Sample

Page 9: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Mean Shifts

• Sometimes the mean of a series changes over time

• It can drift slowly, or change quickly– Possibly due to a policy change

• In this case, forecasting based on a constant mean model can be misleading

Page 10: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

State and Local Government SpendingPercentage Growth Rate (Quarterly)

• Average for 1947‐2013:  3.24%• But this has not been typical in recent years.

Page 11: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Alternatives

• Subsample estimation– Estimate the mean on subsamples– Forecasts are based on the most recent

• Dummy Variable formulation

• τ is the breakdate– The date when the mean shifts– The coefficient  β0  is the mean before  t=τ– The coefficient  β1  is the shift at  t=τ– The sum  β0+β1  is the mean after t=τ

( )( )τ

ββ≥=+=Ω+

tddy

t

ttht

1|E 10

Page 12: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Forecast• Linear Regression  yt+h on dt• Example

– State and Local Government Percentage Growth– Mean breaks in 1970q1 and 2002q1

Page 13: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Fitted

• Out‐of‐sample forecast falls from 3.2% to ‐0.14%! 

Page 14: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Should you use Mean Shifts?

• Only after great hesitation and consideration.• Should use shifts and breaks reluctantly and with care.

• Do you have a model or explanation?• What is the forecasting power of a mean shift? 

– If they have happened in the past, will there be more in the future?

• Yet, if there has been an obvious shift, a simple constant mean model will forecast terribly.

Page 15: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

How to Select Breakdates

• Judgmental– Dates of known policy shifts– Important events– Economic crises

• Informal data‐based– Visual inspection

• Formal data‐based– Estimate regression for many possible breakdates– Select one which minimizes sum of squared error– This is the least‐squares breakdate estimator

Page 16: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

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 17: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

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 examples from another textbook (Diebold: Elements of Forecasting)

• They did not forecast well out of sample.

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

Page 18: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

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)

• We will estimate on 1948‐1992

• Forecast 1993‐2009

Page 19: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Women’s Labor Participation Rate1948‐1992

Page 20: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Men’s Labor Participation Rate1948‐1992

Page 21: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

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 22: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Example 2Retail Sales, Current Dollars

• From Census Bureau

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

• We will 1955‐1991

• Forecast 1992‐current

Page 23: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Retail Sales1955‐1993

Page 24: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

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 25: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Example 3Transaction Volume, S&P Index

• From Yahoo Finance

• Weekly, 1950‐current

• We estimate on 1955‐1993

• Forecast 1994‐2001

Page 26: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Transaction Volume

Page 27: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

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 28: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Ln(Volume)

• In logarithms, trend is roughly linear.

Page 29: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

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 30: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Linear Models

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

or

where– x1t = Timet– x2t = Timet2

ttt xxT 22110 βββ ++=

tt xT 110 ββ +=

Page 31: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Example 4Real GDP

• From BEA

• Quarterly, 1947‐2009

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

• Also use an exponential trend

Page 32: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Real GDP

Page 33: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Ln(Real GDP)

Page 34: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

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  b0 and  b1 are estimates

tt xT 10 ββ +=

Page 35: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

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 36: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

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 37: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

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 38: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

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 xxT 22110 βββ ++=

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

Page 39: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

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 40: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Example 1Women’s Labor Force Participation Rate

Page 41: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Regression Estimation

Page 42: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

In‐Sample Fit

Page 43: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Residuals

• Residuals are difference between data and fitted regression line

tht

thtt

TimebbyTye

10

ˆ−−=

−=

+

+

Page 44: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

Residual Plot

Page 45: Estimation Uncertainty - SSCCssc.wisc.edu/~bhansen/390/390Lecture5.pdf · 2014-01-30 · • While in some cases, trend forecasting can be useful. • In many cases, it can be hazardous.

In‐Sample Fit

• Compute with predict command• Fit looks good