Transcription of Time Series and Forecasting Lecture 3 Forecast …
1 time Series and ForecastingLecture 3 Forecast Intervals, multi - step ForecastingBruce E. HansenSummer School in Economics and EconometricsUniversity of CreteJuly 23-27, 2012 Bruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 20121 / 102 Today s ScheduleReviewForecast IntervalsForecast DistributionsMulti- step Direct ForecastsFan ChartsIterated ForecastsBruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 20122 / 102 ReviewOptimal point Forecast ofyn+1given informationInis the conditionalmeanE(yn+1jIn)Estimate linear approximations by least-squaresCombine point forecasts to reduce MSFES elect estimators and combination weights by cross-validationEstimate GARCH models for conditional varianceBruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 20123 / 102 interval ForecastsTake the form[a,b]Should containyn+1with probability 1 2 1 2 =Pn(yn+12[a,b])=Pn(yn+1 b) Pn(yn+1 a)=Fn(b) Fn(a)whereFn(y)is the Forecast distributionIt follows thata=qn( )b=qn(1 )
2 A= th andb= (1 ) th quantile of conditional distributionBruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 20124 / 102 interval Forecasts are Conditional QuantilesThe ideal 80% Forecast interval , is the 10% and 90% quantile of theconditional distribution ofyn+1givenInOur feasible Forecast intervals are estimates of the 10% and 90%quantile of the conditional distribution ofyn+1givenInThe goal is to estimate conditional Hansen (University of Wisconsin)ForecastingJuly 23-27, 20125 / 102 Mean-Variance ModelWriteyt+1= t+ t t+1 t=E(yt+1jIt) 2t=var(yt+1jIt)Assume that t+1is independent ( )andq ( )be the th quantiles ofyt+1and t+ ( ) = t+ tq ( )Thus a(1 2 ) Forecast interval foryn+1is[ n+ nq ( ), n+ nq (1 )]Bruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 20126 / 102 Mean-Variance ModelGiven the conditional mean nand variance 2n, the conditionalquantile ofyn+1is a linear function n+ nq ( )of the conditionalquantileq ( )of the normalized error n+1=en+1 nInterval forecasts thus can be summarized by n, 2n,andq ( )Bruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 20127 / 102 Normal Error Quantile ForecastsMake the approximation t+1 N(0,1)IThenq ( ) =Z(a)are normal quantilesIUseful simpli cation, especially in small , , , quantiles areI , , , intervals[b n+b nZ( ),b n+b nZ(1 )]Bruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 20128 / 102 Nonparametric Error Quantile ForecastsLet t+1 Fbe unknownIWe can estimateq ( )as the empirical quantiles of the residualsISetb t+1=eet+1b tISortb 1.
3 ,b ( )andbq (1 )are the th and(1 ) th percentiles[b n+b nbq ( ),b n+b nbq (1 )]Computationally simpleReasonably accurate whenn 100 Allows asymmetric and fat-tailed error distributionsBruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 20129 / 102 Constant Variance CaseIfb t=b is a constant, there is no advantage for estimation ofb forforecast intervalLetbqe( )andbqe(1 )be the th and(1 ) th percentiles oforiginal residualseet+1 Forecast interval :[b n+bq ( ),b n+bqe(1 )]When the estimated variance is a constant, this is numericallyidentical to the de nition with rescaled errorsb t+1 Bruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201210 / 102 Computation in RquadregpackageImay need to be installedIlibrary(quadreg)IrqcommandIfei s vector of (normalized) residuals andais the quantile to beevalulatedIrq(e~1,a)Iq=coef(rq(e~1,a)) IQuantile regression ofeon an interceptBruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201211 / 102 Example: Interest Rate Forecastn=603 observationsb t+1=eet+1b tfrom GARCH(1,1) , , , quantiles , , , Forecast = Forecast interval =[ , ]80% Forecast interval =[ , ]Bruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201212 / 102 Example.
4 GDPn=207 observationsb t+1=eet+1b tfrom GARCH(1,1) , , , quantiles , , , Forecast = Forecast interval =[ , ]80% Forecast interval =[ , ]Bruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201213 / 102 Mean-Variance Model interval Forecasts - SummaryThe key is to break the distribution into the mean t,variance 2tandthe normalized error t+1yt+1= t+ t t+1 Then the distribution ofyn+1is determined by n, 2nand thedistribution of n+1 Each of these three components can be separately approximated andestimatedTypically, we put the most work into modeling (estimating) the mean tIThe remainder is modeled more simplyIFor macro forecasts, this re ects a belief (assumption?) that most ofthe predictability is in the mean, not the higher Hansen (University of Wisconsin)ForecastingJuly 23-27, 201214 / 102 Alternative Approach: Quantile RegressionRecall, the ideal 1 2 interval is[qn( ),qn(1 )]qn( )is the th quantile of the one- step conditional distributionFn(y) =P(yn+1 yjIn)Equivalently, let s directly model the conditional quantile functionBruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201215 / 102 Quantile Regression FunctionThe conditional distribution isP(yn+1 yjIn)'P(yn+1 yjxn)The conditional quantile functionq (x)solvesP(yn+1 q (x)jxn=x)= (x)is the conditional (x)is the 10% quantile (x)is the 90% quantile functionBruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201216 / 102 Quantile Regression FunctionsFor each ,q (x)is an arbitrary function ofxFor eachx,q (x)is monotonically increasing in Quantiles are well de ned even when moments are in niteWhen distributions are discrete then quantiles may be intervals weignore thisWe approximate the functions as linear inq (x)q (x)
5 'x0 (after possible transformations inx)The coe cient vectorx0 depends on Bruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201217 / 102 Linear Quantile Regression Functionsq (x) =x0 If only the intercept depends on ,q (x)' +x0 then the quantile regression lines are parallelIThis is when the erroret+1in a linear model isindependentof theregressorsIStrong conditional homoskedasticityIn general, the coe cients are functions of ISimilar to conditional heteroskedasticityBruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201218 / 102 interval ForecastsAn ideal 1 2 interval Forecast interval is x0n ,x0n 1 Note that the ideal point Forecast isx0n where is the best linearpredictorAn alternative point Forecast is the conditional medianx0n has the property of being the best linear predictor inL1(meanabsolute error)All are linear functions ofxn,just di erent functionsA feasible Forecast interval ishx0nb ,x0nb 1 iwhereb andb 1 are estimates of and 1 Bruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201219 / 102 Check FunctionRecall that the mean =EYminimizes theL2riskE(Y m)2 Similarly the theL1riskEjY mjThe th quantileq minimizes the check function riskE (Y m)where (u)=8<.
6 U(1 )u<0u u 0=u( 1(u<0))This is a tilted absolute value functionTo see the equivalence, evaluate the rst order condition forminimizationBruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201220 / 102 Extremum Representationq (x)solvesq (x) =argminmE( (yt+1 m)jxt=x)Sample criterionS ( ) =1nn 1 t=0 yt+1 x0t Quantile regression estimatorb =argmin S ( )Computation by linear programmingIStataIRIM atlabBruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201221 / 102 Computation in RquantregpackageImay need to be installedIlibrary(quantreg)IFor quantile regression ofyonxata th quantileFdo not include intercept inx,it will be automatically includedIrq(y~x,a)IFor coe cients,Fb=coef(rq(y~x,a))Bruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201222 / 102 Distribution TheoryThe asymptotic theory for the dependent data case is not welldevelopedThe theory for the cross-section (iid) case is Angrist, Chernozhukovand Fernandez-Val (Econometrica, 2006)Their theory allows for quantile regression viewed as a best linearapproximationpn b d !
7 N(0,V )V =J 1 J J =E fy x0t jxt xtx0t =E xtx0tu2t ut=1 yt+1<x0t Under correct speci cation, = (1 )E(xtx0t)I suspect that this theorem extends to dependent data if the score isuncorrelated (dynamics are well speci ed)Bruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201223 / 102 Standard ErrorsThe asymptotic variance depends on the conditional density functionINonparametric estimation!To avoid this, most researchers use bootstrap methodsFor dependent data, this has not been exploredRecommend: Use current software, but be cautious!Bruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201224 / 102 Crossing Problem and SolutionThe conditional quantile functionsq (x)are monotonically increasingin But the linear quantile regression approximationsq (x)'x0 cannot be globally monotonic in ,unless all lines are parallelThe regression approximations may cross!The estimatesbq (x) =x0b may cross!
8 If this happens, Forecast intervals may be inverted:IA 90% interval may not nest an 80% intervalSimple Solution: ReorderingIIfbq 1(x)>bq 2(x)when 1< 2<12,simply setbq 1(x) =bq 2(x),and conversely quantiles above12 ITake the wider intervalIThen the endpoint of the two intervals will be the sameBruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201225 / 102 Model Selection and CombinationTo my knowledge, no theory of model selection for median regressionor quantile regression, even in iid contextA natural conjecture is to use cross-validation on the sample checkfunctionIBut no current theory justi es this choiceMy recommendation for model selection (or combination)ISelect the model for the conditional mean by cross-validationIUse the same variables for all quantilesISelect the weights by cross-validation on the conditional meanIFor each quantile, estimate the models with positive weightsITake the weighted combination using the same Hansen (University of Wisconsin)
9 ForecastingJuly 23-27, 201226 / 102 Example: Interest RatesAR(2) Speci cation (selected for regression by CV)yt+1= 0+ 1yt+ 2yt 1+et = = = = 0 2 10% (xn) = + 150% Forecast interval =[ , ]80% Forecast interval =[ , ]Very close to those from mean-variance estimatesBruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201227 / 102 Example: GDPL eading Indicator Modelyt+1= 0+ 1yt+ 2 Spreadt+ 3 HighYield+ 4 Starts+ 5 Permits+et = = = = 0 3 4 Forecast interval =[ , ]80% Forecast interval =[ , ]Bruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201228 / 102 Distribution ForecastsThe conditional distribution isFt(y) =P(yt+1 yjIt)It is not common to directly reportFt(y)Ior the one- step Forecast distributionFn(y)However,Ft(y)may be used as an inputFor example, simulationWe thus may want an estimatebFt(y)ofFt(y)Bruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201229 / 102 Mean-Variance Model Distribution ForecastsModelyt+1= t+ t t+1with t+1is independent t+1have distributionF (u) =P( t u).
10 The conditional distribution ofyt+1isFt(y) =F yt+1 t t EstimationbFt(y) =bF yt+1 b tb t wherebF (u)is an estimate ofF (u) =P( t u).Bruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201230 / 102 Normal Error ModelUnder the assumption t+1 N(0,1),F (u) = (u),the normalCDFbFt(y) = y b tb t To simulate frombFt(y)ICalculateb tandb tIDraw t+1iid fromN(0,1)Iy t+1=b t+b t t+1 The normal assumption can be used when sample sizenis very smallBut thenbFt(y)contains no information beyondb tandb tBruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201231 / 102 Nonparametric Error ModelLetbF nbe the empirical distribution function (EDF) of the normalizedresidualsb t+1 The EDF puts probability mass 1/nat each pointfb 1,..,b ngbF n(u) =n 1n 1 t=01(b t+1 u)bFt(y) =bF n y b tb t =n 1n 1 j=01 y b tb t b j+1 =n 1n 1 j=01(y b t+b tb j+1)Notice the summation overj,holdingb t,b t xedBruce Hansen (University of Wisconsin)ForecastingJuly 23-27, 201232 / 102 Simulate Estimated Conditional DistributionTo simulateICalculateb tandb tIDraw t+1iid from normalized residualsfb 1.