ECON 240C Lecture 7
Outline Autoregressive of Order two, one , and zero The boundaries of stability for parameters b1, b2
Autoregressive Processes Order two: x(t) = b1 * x(t-1) + b2 * x(t-2) + wn(t) If b2 = 0, then of order one: x(t) = b1 * x(t-1) + wn(t) If b1 = b2 = 0, then of order zero: x(t) = wn(t)
Quadratic Form and Roots x(t) = b1 * x(t-1) + b2 * x(t-2) + wn(t) is a second order stochastic difference equation. If you drop the stochastic term, wn(t), then you have a second order deterministic difference equation: x(t) = b1 * x(t-1) + b2 * x(t-2) , Or, x(t) - b1 * x(t-1) - b2 * x(t-2) = 0 And substituting y2-u for x(t-u), y2 – b1*y – b2 = 0, we have a quadratic equation
Roots and stability Recall, for a first order autoregressive process, x(t) – b1 *x(t-1)= wn(t), i.e. where b2 = 0, then if we drop the stochastic term, and substitute y1-u for x(t-u), then y – b1 =0, and the root is b1 . This root is unstable, i.e. a random walk if b1 = 1. In an analogous fashion, for a second order process, if b1 = 0, then x(t) = b2 *x(t-2) + wn(t), similar to a first order process with a time interval twice as long, and if the root b2 =1, we have a random walk and instability
Unit Roots and Instability Suppose one root is unity, i.e. we are on the boundary of instability, then factoring the quadratic from above, y2 – b1*y – b2 = (y -1)*(y –c), where (y-1) is the root, y=1, and c is a constant. Multiplying out the right hand side and equating coefficients on the terms for y2, y, and y0 on the left hand side: y2 – b1*y – b2 = y2 –y –c*y + c = y2 –(1+c)*y + c So – b1 = -(1+c), and –b2 = c Or b1 + b2 =1, and b2 = 1 – b1 , the equation for a boundary of the triangle
Triangle of Stable Parameter Space If b2 = 0, then we have a first order process, ARTWO(t) = b1 ARTWO(t-1) + WN(t), and for stability -1<b1 <1 -1 1 b1
Triangle of Stable Parameter Space If b1 = 0, then we have a process, ARTWO(t) = b2 ARTWO(t-2) + WN(t), that behaves like a first order process with the time interval two periods instead of one period. For example, starting at ARTWO(0) at time zero, ARTWO(2) = b2 ARTWO(0) , ignoring the white noise shocks, and ARTWO(4) = b2 ARTWO(2) = b22 ARTWO(0) and for stability -1<b2 <1
Triangle of Stable Parameter Space 1 b2 b1 = 0 -1
Triangle of Stable Parameter Space: Boundary points b2 = 1 – b1 If b1 = 0, b2 = 1, If b1 = 1, b2 =0, If b2 = -1, b1 =2 1 b2 -1 b1 = 0 +1 -1 Draw a horizontal line through (0, -1) for (b1, b2)
Triangle of Stable Parameter Space: (0, 1) b2 (-1, 0) (1, 0) b1 = 0 (0, -1) Draw a line from the vertex, for (b1=0, b2=1), though the end points for b1, i.e. through (b1=1, b2= 0) and (b1=-1, b2=0),
Triangle of Stable Parameter Space: (0,1) b2 = 1 - b1 b2 (-1, 0) (1, 0) b1 = 0 (2, -1) -1 Note: along the boundary, when b1 = 0, b2 = 1, when b1 = 1, b2 = 0, and when b2 = -1, b2 = 2.
Triangle of Stable Parameter Space: (0, 1) b2 b1<0 b2>0 b1>0 b2>0 (-1, 0) (1, 0) b1<0 b2<0 b1 = 0 b1>0 b2<0 (0, -1)
Is the behavior different in each Quadrant? (0, 1) II b2 b1<0 b2>0 b1>0 b2>0 (-1, 0) I (1, 0) b1<0 b2<0 b1 = 0 b1>0 b2<0 III IV (0, -1)
We could study with simulation
Is the behavior different in each Quadrant? (0, 1) II b2 b1= -0.3 b2= 0.3 b1= 0.3 b2= 0.3 (-1, 0) I (1, 0) b1= -0.3 b2= -0.3 b1 = 0 b1= 0.3 b2= -0.3 III IV (0, -1)
Simulation Sample 1 1000 Genr wn=nrnd Sample 1 2 Genr artwo =wn Genr artwo = 0.3*artwo(-1)+0.3*artwo(-2) + wn
(0, 1) (-0.3, 0.3) 0.3, 0.3) (-1, 0) (1, 0) (-0.3, -0.3) (0.3, -0.3) (0, -1)
Three Study Possibilities I. Analytical derivation II. Simulation III. Empirical “analysis” or deconstruction Capacity utilization, manufacturing
Forecast C = 0 E2006.3 dcaputmfg(2006.4) - C ] = E2006.3 {0.278*[dcaputmfg(2006.3) - C] +0.250[dcaputmfg(2006.2)- C] + wn*(2006.4)} E2006.3 dcapumfg(2006.4) = 0.278*[0.2] + 0.25*[-0.3] E2006.3 dcapumfg(2006.4) = 0.278*[0.2] + 0.25[-0.3] E2006.3 dcapumfg(2006.4) = 0.0556 – 0.075 = -0.0194 Forecast ~- 0.02 with ser = 0.582
Forecast through end of 2006
Three Study Possibilities I. Analytical derivation II. Simulation III. Empirical “analysis” or deconstruction Capacity utilization, manufacturing Private housing starts
Correlogram of residuals from ARTWO Model of Starts. Significant Q-stat. No obvious pattern
Correlogram of residuals from ARTHREE Model of Starts
Correlogram of residuals from ARTWO Model of dstarts. Q-stats better
Quadratic roots ax2 + bx +c = 0 y2 – b1*y – b2 = 0 If b12 + 4b2 <0 then we have the square root of a negative Number, and imaginary or complex roots. For example, (-4)1/2 = 2(-1)1/2 =2i, where i is the imaginary number
(-0.34, -0.14) dstarts (1.49, -0.575) capumfg
Part III. Autoregressive of the Second Order ARTWO(t) = b1 *ARTWO(t-1) + b2 *ARTWO(t-2) + WN(t) ARTWO(t) - b1 *ARTWO(t-1) - b2 *ARTWO(t-2) = WN(t) ARTWO(t) - b1 *Z*ARTWO(t) - b2 *Z*ARTWO(t) = WN(t) [1 - b1 *Z - b2 *Z2] ARTWO(t) = WN(t)
Autocovariance Function ARTWO(t) = b1 *ARTWO(t-1) + b2 *ARTWO(t-2) + WN(t) Using x(t) for ARTWO, x(t) = b1 *x(t-1) + b2 *x(t-2) + WN(t) By lagging and substitution, one can show that x(t-1) depends on earlier shocks, so multiplying by x(t-1) and taking expectations
Autocovariance Function x(t) = b1 *x(t-1) + b2 *x(t-2) + WN(t) x(t)*x(t-1) = b1 *[x(t-1)]2 + b2 *x(t-1)*x(t-2) + x(t-1)*WN(t) Ex(t)*x(t-1) = b1 *E[x(t-1)]2 + b2 *Ex(t-1)*x(t-2) +E x(t-1)*WN(t) gx, x (1) = b1 * gx, x (0) + b2 * gx, x (1) + 0, where Ex(t)*x(t-1), E[x(t-1)]2 , and Ex(t-1)*x(t-2) follow by definition and E x(t-1)*WN(t) = 0 since x(t-1) depends on earlier shocks and is independent of WN(t)
Autocovariance Function gx, x (1) = b1 * gx, x (0) + b2 * gx, x (1) dividing though by gx, x (0) rx, x (1) = b1 * rx, x (0) + b2 * rx, x (1), so rx, x (1) - b2 * rx, x (1) = b1 * rx, x (0), and rx, x (1)[ 1 - b2 ] = b1 , or rx, x (1) = b1 /[ 1 - b2 ] Note: if the parameters, b1 and b2 are known, then one can calculate the value of rx, x (1)
Autocovariance Function x(t) = b1 *x(t-1) + b2 *x(t-2) + WN(t) x(t)*x(t-2) = b1 *[x(t-1)x(t-2)] + b2 *[x(t-2)]2 + x(t-2)*WN(t) Ex(t)*x(t-2) = b1 *E[x(t-1)x(t-2)] + b2 *E[x(t-2)]2 +E x(t-2)*WN(t) gx, x (2) = b1 * gx, x (1) + b2 * gx, x (0) + 0, where Ex(t)*x(t-2), E[x(t-2)]2 , and Ex(t-1)*x(t-2) follow by definition and E x(t-2)*WN(t) = 0 since x(t-2) depends on earlier shocks and is independent of WN(t)
Autocovariance Function gx, x (2) = b1 * gx, x (1) + b2 * gx, x (0) dividing though by gx, x (0) rx, x (2) = b1 * rx, x (1) + b2 * rx, x (0) Note: if the parameters, b1 and b2 are known, then one can calculate the value of rx, x (1), as we did above from rx, x (1) = b1 /[ 1 - b2 ], and then calculate rx, x (2).
Autocorrelation Function rx, x (2) = b1 * rx, x (1) + b2 * rx, x (0) Note also the recursive nature of this formula, so rx, x (u) = b1 * rx, x (u-1) + b2 * rx, x (u-2), for u>=2. Thus we can map from the parameter space to the autocorrelation function. How about the other way around?
Yule-Walker Equations From slide 20 above, rx, x (1) = b1 * rx, x (0) + b2 * rx, x (1), and so b1 = rx, x (1) - b2 * rx, x (1) From slide 23 above, rx, x (2) = b1 * rx, x (1) + b2 * rx, x (0), or b2 = rx, x (2) - b1 * rx, x (1) , and substituting for b1 from line 3 above b2 = rx, x (2) - [rx, x (1) - b2 * rx, x (1)] rx, x (1)
Yule-Walker Equations b2 = rx, x (2) - {[rx, x (1)]2 - b2 * [rx, x (1)]2 } so b2 = rx, x (2) - [rx, x (1)]2 + b2 * [rx, x (1)]2 and b2 - b2 * [rx, x (1)]2 = rx, x (2) - [rx, x (1)]2 so b2 [1- rx, x (1)]2 = rx, x (2) - [rx, x (1)]2 and b2 = {rx, x (2) - [rx, x (1)]2}/ [1- rx, x (1)]2 This is the formula for the partial autocorrelation at lag two.
Partial Autocorrelation Function b2 = {rx, x (2) - [rx, x (1)]2}/ [1- rx, x (1)]2 Note: If the process is really autoregressive of the first order, then rx, x (2) = b2 and rx, x (1) = b, so the numerator is zero, i.e. the partial autocorrelation function goes to zero one lag after the order of the autoregressive process. Thus the partial autocorrelation function can be used to identify the order of the autoregressive process.
Partial Autocorrelation Function If the process is first order autoregressive then the formula for b1 = b is: b1 = b =ACF(1), so this is used to calculate the PACF at lag one, i.e. PACF(1) =ACF(1) = b1 = b. For a third order autoregressive process, x(t) = b1 *x(t-1) + b2 *x(t-2) + b3 *x(t-3) + WN(t), we would have to derive three Yule-Walker equations by first multiplying by x(t-1) and then by x(t-2) and lastly by x(t-3), and take expectations.
Partial Autocorrelation Function Then these three equations could be solved for b3 in terms of rx, x (3), rx, x (2), and rx, x (1) to determine the expression for the partial autocorrelation function at lag three. EVIEWS does this and calculates the PACF at higher lags as well.
Part IV. Forecasting Trend
Lab Two: LNSP500
Note: Autocorrelated Residual
Autocorrelation Confirmed from the Correlogram of the Residual
Visual Representation of the Forecast
Numerical Representation of the Forecast
Note: The Fitted Trend Line Forecasts Above the Observations
One Period Ahead Forecast Note the standard error of the regression is 0.2237 Note: the standard error of the forecast is 0.2248 Diebold refers to the forecast error without parameter uncertainty, which will just be the standard error of the regression or with parameter uncertainty, which accounts for the fact that the estimated intercept and slope are uncertain as well
Parameter Uncertainty Trend model: y(t) = a + b*t + e(t) Fitted model:
Parameter Uncertainty Estimated error
Forecast Formula
Forecast Et
Forecast Forecast = a + b*(t+1) + 0
Variance in the Forecast Error
Part II: Autocovariance of a First Order Moving Average Process MAONE(t) = WN(t) + a*WN(t-1) MAONE(t) = WN(t) + a*Z*WN(t) MAONNE(t) = [! + a*Z]WN(t) Mean Function, m(t) = E[WN(t) + a*WN(t-1)] = 0
Autocovariance at Lag Zero E[MAONE(t)*MAONE(t)] = E{[WN(t) + a*WN(t-1)][WN(t) + a*WN(t-1)]} E{MAONE(t)*MAONE(t)} =EWN(t)*WN(t) +2EaWN(t) WN(t-1) + Ea2WN(t-1)WN(t-1) E{MAONE(t)*MAONE(t)}= s2 +a2 s2
Autocovariance at Lag One E[MAONE(t)*MAONE(t-1)] = E{[WN(t) + a WN(t-1)][WN(t-1) + a WN(t-2)]} = a s2 rMA,MA (1) = a/(1 + a2)
Autocovariance at Lag two E[MAONE(t)*MAONE(t-2)] = E{[WN(t) + a WN(t-1)][WN(t-2) + a WN(t-3)]} = 0 Note: there are no cross-product terms of white noise that are at the same time period, so by the property of independence, rMA,MA (u) = 0, u>1 Note that the the autocorrelations are zero for lags greater than the order of the MA process, so that the autocorrelation function identifies the order of an MA process.
Autocorrelation Function, Moving Average of the first Order
Triangle of Stable Parameter Space If we are along the right hand diagonal border of the parameter space then we are on the boundary of stability, I.e. there must be a unit root, and from: [1 - b1 *Z - b2 *Z2] ARTWO(t) = WN(t) ignoring white noise shocks, [1 - b1 *Z - b2 *Z2] = [1 -Z][1 + c Z], where multiplying the expressions on the right hand side(RHS), noting that c is a parameter to be solved for and setting the RHS equal to the LHS:
[1 - b1 *Z - b2 *Z2] = [1 + (c - 1)Z -c Z2], so - b1 = c - 1, and - b2 = -c, or b1 = 1 - c , (line2) b2 = c , (line 3) and adding lines 2 and 3: b1 + b2 = 1, so b2 = 1 - b1 , the formula for the right hand boundary
Part I: Variance of an ARONE ARONE(t) = b*ARONE(t-1) + WN(t) ARONE(t) - b*ARONE(t-1) = WN(t) ARONE(t) - b*Z*ARONE(t) = WN(t) [1 – b*Z]ARONE(t) =WN(t) ARONE(t) = {1/[1-b*Z]}WN(t) ARONE(t) = {1+b*Z+b2*Z2+…]WN(t) ARONE(t) = WN(t)+b*Z*WN(t) + …. ARONE(t) = WN(t) + b*WN(t-1) + b2*WN(t-2) + … With the ARONE expressed in synthetic form,
Take expectation of the product [ARONE(t)]2: E{ARONE(t)*ARONE(t)} = E{[WN(t) +b*WN(t-1) + …][WN(t) + b*WN(t-1) + …]} E{ARONE(t)*ARONE(t)}=E[WN(t)*WN(t) + b2 WN(t-1)*WN(t-1) + b*WN(t)WN(t-1) + …] E{ARONE(t)*ARONE(t)}= s2 + b2* s2 + b4s2 + …. =[1 + b2 + b4 …] s2 E{ARONE(t)*ARONE(t)}= {1/[1-b2]}* s2 Note the role independence of white noise plays