Вы находитесь на странице: 1из 34

TimeSeriesComponents

Recallthattheoptimalpointforecastofaseries yt+h isitsconditionalmean


t = E ( yt + h | t )

Itisusefultodecomposethismeaninto components t = Tt + St + Ct
Tt =Trend St=Seasonal Ct=Cycle

Components
Trend
Verylongterm(decades) Smooth

Seasonal
Patternswhichrepeatannually Maybeconstantorvariable

Cycle
Businesscycle Correlationover27years

Itisusefultoconsiderthecomponentsseparately WestartwiththeTrend

TrendForecasting
Apuretrendmodelhasnoseasonalorcycle

t = Tt
Inapuretrendmodel,theoptimalpoint forecastforyt+h is t=Tt . AnactualforecastisanestimateofTt .

ModelingTrend
Mosttrendmodelsareverysimple Simplestpossibletrendisaconstant

Tt = 0
Thismightseemoverlysimple,butis appropriateforstationary timeseries
Aseriesnotgrowingorchangingovertime Manyseriesreportedaspercentagechanges

U.S.PersonalConsumption(Quarterly) MonthlyPercentageChange

Estimation
IfE(yt+h | t)=t=Tt =0thentheoptimalforecast isthemean 0 =E(yt+h) Theestimateof0 isthesamplemean
1 T b0 = yt + h T t =1

Thisistheestimateoftheoptimalpointforecast whent=0 b0 isalsotheleastsquaresestimateinan interceptonlymodel

Estimation
InSTATA,usetheregress command SeeSTATAHandout onwebsite Samplemeanisestimatedconstant

FittedValues
Fittedvaluesarethesamplemean
t = t = b0 y

InSTATAusethepredict command

Thiscreatesavariableypoffittedvalues

Plotactualagainstfitted

OutofSample
Pointforecastsarethesamplemean
T + h = b0 y

InSTATA,usetsappend toexpandsample,and predict togeneratepointforecasts.

OutofSample

ForecastErrors
Theforecasterroret isthedifference betweentherealizedvalueandthe conditionalmean.
et = yt + h t

orequivalently
yt + h = t + et

Wecallet theforecasterror.

Residuals
Theresidualsaretheinsamplefittederrors. Thedifferencebetweentherealizedvalueand theinsampleforecast.
t = yt + h t e = yt + h b0

Ingeneral,itisusefultoplottheresiduals againsttime,toseeifanytimeseriespattern remains.

CalculateandPlotResiduals

EstimationUncertainty
Thesamplemean
1 T b0 = yt + h T t =1

isanestimateof0 =E(yt+h) Theestimationerroris


1 T b0 0 = yt + h 0 T t =1 1 T = ( yt + h 0 ) T t =1 1 T = et T t =1

EstimationVariance
Underclassicalconditions,
var(b0 ) =

2
T

where2=var(et) Thestandarderrorforb0 isanestimateofthe standarddeviation


sd (b0 ) = 2 T

ForecastVariance
Whenthesamplemeanb0 isusedasthe forecastforyT+h thenthepredictionerroris
yT + h b0 = eT + h + 0 b0

whichisthesumoftheforecasterroreT+h and theestimationuncertainty0b0. Theforecastvarianceis


var( yT + h b0 ) = var(eT + h ) + var( 0 b0 ) = +
2

T 1 = 1 + 2 T

StandardDeviationofForecast
Thestandarddeviationoftheforecastisthe estimate 1
2 sT + h = 1 + T

Thisisslightlylargerthantheregression standarddeviation

NormalForecastIntervals
LetT+h beaforecastforyT+h ThepredictionerrorisyT+h T+h LetsT+h bethest.deviationoftheforecast Ifthepredictionerrorsarenormallydistributed, the(1)%forecastintervalendpointsare
T + h + sT + h z / 2 LT + h = y T + h + sT + h z1 / 2 UT +h = y

wherez/2 andz1/2arethe/2and1/2 quantiles ofthenormaldistribution e.g.T+h1.64 sT+h fora90%interval

DeficiencyofNormalIntervals
Thenormalforecastintervalisbasedonthe assumption thatthepredictionerrorsare normallydistributed. Thisrequiresthattheconditionaldistribution ofyT+h benormal,whichisrarelyvalid. Instead,wecancomputeforecastintervals basedontheempiricaldistributionofthe forecastresiduals.

Empircal ForecastIntervals
Lett+h befittedvaluesforyt+h withresiduals
t = yt + h y t +h e

Letq/2 andq1/2bethe/2and1/2 quantiles oftheresiduals. The(1)%forecastintervalendpointsare


T + h + q / 2 LT + h = y T + h + q1 / 2 UT +h = y

EmpiricalForecastIntervals
Thebasicmethodtoobtainforecastintervals isthesameforanyregressionmodel yt + h = t + et The(1)%forecastintervalendpointsare
LT + h = T + q / 2 U T + h = t + q1 / 2

whereq/2 andq1/2arethe/2and1/2 quantiles ofthedistributionofet .

Quantiles
Thexth quantile ofasetofnumbersisthe valueqx suchthatx%aresmallerthanqx and(1x)%arelargerthanqx. Youcanfindqx bysortingthedata. InSTATA,usetheqreg command
(forquantile regresion)

OutofSample

MeanShifts
Sometimesthemeanofaserieschangesover time Itcandriftslowly,orchangequickly
Possiblyduetoapolicychange

Inthiscase,forecastingbasedonaconstant meanmodelcanbemisleading

StateandLocalGovernmentSpending PercentageGrowthRate(Quarterly)
Averagefor19472009:3.6% Butthishasnotbeenthetypicalrateinrecentyears.

Alternatives
Subsampleestimation
Estimatethemeanonsubsamples Forecastsarebasedonthemostrecent

DummyVariableformulation

t = 0 + 1d t d t = 1(t )
isthebreakdate
Thedatewhenthemeanshifts Thecoefficient0 isthemeanbeforet= Thecoefficient1 istheshiftatt= Thesum0+1 isthemeanaftert=

Forecast
LinearRegressionyt+h ondt Example
StateandLocalGovernmentPercentageGrowth Meanbreaksin1970q1and2002q1

Fitted
Outofsampleforecastfallsfrom3.6%to0.6%!

ShouldyouuseMeanShifts?
Onlyaftergreathesitationandconsideration. Shoulduseshiftsandbreaksreluctantlyandwith care. Doyouhaveamodelorexplanation? Whatistheforecastingpowerofameanshift?
Iftheyhavehappenedinthepast,willtherebemore inthefuture?

Yet,iftherehasbeenanobviousshift,asimple constantmeanmodelwillforecastterribly.

HowtoSelectBreakdates
Judgmental
Datesofknownpolicyshifts Importantevents Economiccrises

Informaldatabased
Visualinspection

Formaldatabased
Estimateregressionformanypossiblebreakdates Selectonewhichminimizessumofsquarederror Thisistheleastsquaresbreakdate estimator

Вам также может понравиться