# ECON 240C - PowerPoint PPT Presentation Download Presentation ECON 240C

ECON 240C Download Presentation ## ECON 240C

- - - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - - -
##### Presentation Transcript

1. ECON 240C Lecture 8

2. Outline: 2nd Order AR • Roots of the quadratic • Example: change in housing starts • Polar form • Inverse of B(z) • Autocovariance function • Yule-Walker Equations • Partial autocorrelation function

3. Outline Cont. • Parameter uncertainty • Moving average processes • Significance of Autocorrelations

4. Roots of the quadratic • X(t) = b1 x(t-1) + b2 x(t-2) + wn(t) • y2 –b1 y – b2 = 0, from substituting y2-u for x(t-u) • y = [b1 +/- (b12 + 4b2)1/2 ]/2 • Complex if (b12 + 4b2) < 0

5. b1 = -0.353, b2 = -0.142 Roots: y = {-0.353 +/- [(-0.353)2 +4(-0.142)]1/2 }/2 y ={ -0.353 +/- (0.125 – 0.568)1/2 }/2 y = -0.177 +/- [-0.443]1/2 /2 * y = -0.177 + 0.333 i, -0.177 – 0.333 i

6. Roots in polar form Im • y = Re + Im i = a + b i • sin  = b/(a2 + b2 )1/2 • cos  = a/(a2 + b2 )1/2 • y = (a2 + b2 )1/2 cos  + i (a2 + b2 )1/2 sin  (a, b) b  a Re

7. Roots in Polar form • Re + i Im = a + i b = (a2 + b2 )1/2 [cos  + sin ] • Example: modulus, (a2 + b2 )1/2 = [(-0.177)2 +(0.333)2 ]1/2 = [0.031 + 0.111]1/2 = 0.377 • Tan  = sin /cos  = b/a = -0.333/-0.177 = 1.88 •  = tan-1 1.88 ~ 62 degrees = 0.172 fraction of a circle = 0.172*2 radians = 1.08 radians • Period = 2*/ = 2 /0.172*2  = 1/0.172 =5.8 months • 5.8 months, the time it takes to go around the circle once

8. Difference Equation Solutions • x(t) –b1 x(t-1) – b2 x(t-2) = 0 • Suppose b2 = 0, then b1 is the root, with x(t) = b1 x(t-1). Suppose x(0) = 100, and b1 =1.2 • then x(1) = 1.2*100, • And x(2) = 1.2*x(1) = (1.2)2 *100, • And the solution is x(t) = x(0)* b1t • In general for roots r1 and r2 , the solution is x(t) = Ar1t + Br2t where A and B are constants

9. 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)

10. Inverse of [1-b1z –b2z2] • ARTWO(t) = wn(t)/B(z) =wn(t)/[1-b1z –b2z2] • ARTWO(t) = A(z) wn(t) = {1/[1-b1z –b2z2]}wn(t) • So A(z) = [1 + a1 z + a2 z2 + …] = 1/[1-b1z –b2z2] • [1-b1z –b2z2] [1 + a1 z + a2 z2 + …] = 1 • 1 + a1 z + a2 z2 + … -b1z – a1 b1z2 - b2 z2… = 1 • 1 + (a1 – b1)z + (a2 –a1 b1 –b2 ) z2 + … = 1 • So (a1 – b1) = 0, (a2 –a1 b1 –b2 ) = 0, …

11. Inverse of [1-b1z –b2z2] • A(z) = [1 + a1 z + a2 z2 + …] = [1 + b1 z + (b12 +b2) z2 + …. • So ARTWO(t) = wn(t) + b1 wn(t-1) + (b12 +b2) wn(t-2)+ …. • And ARTWO(t-1) = wn(t-1) + b1 wn(t-2) + (b12 +b2) wn(t-3)+ ….

12. 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

13. 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)

14. 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)

15. 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)

16. 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) • 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).

17. 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?

18. Yule-Walker Equations • From slide 15 above, • rx, x(1) = b1 * rx, x(0) + b2 * rx, x(1), and so • b1 = rx, x(1) - b2 * rx, x(1) • From slide 17 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)

19. 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.

20. 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.

21. 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.

22. 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.

23. IV. Economic Forecast Project • Santa Barbara County Seminar • April 26, 2006 • URL: http://www.ucsb-efp.com

24. V. Forecasting Trends

25. Lab Two: LNSP500

26. Note: Autocorrelated Residual

27. Autorrelation Confirmed from the Correlogram of the Residual

28. Visual Representation of the Forecast

29. Numerical Representation of the Forecast

30. 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

31. Parameter Uncertainty • Trend model: y(t) = a + b*t + e(t) • Fitted model:

32. Parameter Uncertainty • Estimated error

33. Forecast Formula

34. Forecast Minus its Expected Value • Forecast = a + b*(t+1) + 0

35. Variance in the Forecast

36. Variance of the Forecast Error 0.000501 +2*(-0.00000189)*398 + 9.52x10-9*(398)2 +(0.223686)2 0.000501 - 0.00150 + 0.001508 + 0.0500354 0.0505444 SEF = (0.0505444)1/2 = 0.22482

37. Numerical Representation of the Forecast

38. Evolutionary Vs. Stationary • Evolutionary: Trend model for lnSp500(t) • Stationary: Model for Dlnsp500(t)

39. Pre-whitened Time Series

40. Note: 0 008625 is monthly growth rate; times 12=0.1035

41. Is the Mean Fractional Rate of Growth Different from Zero? • Econ 240A, Ch.12.2 • where the null hypothesis is that m = 0. • (0.008625-0)/(0.045661/3971/2) • 0.008625/0.002292 = 3.76 t-statistic, so 0.008625 is significantly different from zero

42. Model for lnsp500(t) • Lnsp500(t) = a +b*t +resid(t), where resid(t) is close to a random walk, so the model is: • lnsp500(t) a +b*t + RW(t), and taking exponential • sp500(t) = ea + b*t + RW(t) = ea + b*t eRW(t)

43. Note: The Fitted Trend Line Forecasts Above the Observations

44. VI. Autoregressive Representation of a Moving Average Process • MAONE(t) = WN(t) + a*WN(t-1) • MAONE(t) = WN(t) +a*Z*WN(t) • MAONE(t) = [1 +a*Z] WN(t) • MAONE(t)/[1 - (-aZ)] = WN(t) • [1 + (-aZ) + (-aZ)2 + …]MAONE(t) = WN(t) • MAONE(t) -a*MAONE(t-1) + a2 MAONE(t-2) + .. =WN(t)

45. MAONE(t) = a*MAONE(t-1) - a2*MAONE(t-2) + …. +WN(t)

46. Lab 4: Alternating Pattern in PACF of MATHREE