economics 470: economic fluctuations and …faculty.wwu.edu/kriegj/course/470...

12
Economics 470: Economic Fluctuations and Forecasting Homework #5: Answers This homework is due on Tuesday, February 19 th . 1. For each of the following functional forms, solve for (0), (1), (2), and (3). In addition, sketch additional autocorrelations and partial autocorrelations for both positive and negative combinations of the parameters. a. Y t = B 0 + 1 Y t-1 + 2 Y t-2 + t . b. Y t = B 0 + Y t-1 + t + t-1 .

Upload: others

Post on 25-Apr-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Economics 470: Economic Fluctuations and …faculty.wwu.edu/kriegj/Course/470 Homework/Hw5ans.docx · Web viewEconomics 470: Economic Fluctuations and Forecasting Homework #5: Answers

Economics 470: Economic Fluctuations and ForecastingHomework #5: Answers

This homework is due on Tuesday, February 19th.

1. For each of the following functional forms, solve for (0), (1), (2), and (3). In addition, sketch additional autocorrelations and partial autocorrelations for both positive and negative combinations of the parameters.

a. Yt = B0 + 1Yt-1 + 2Yt-2 + t.b. Yt = B0 + Yt-1 + t + t-1.

Page 2: Economics 470: Economic Fluctuations and …faculty.wwu.edu/kriegj/Course/470 Homework/Hw5ans.docx · Web viewEconomics 470: Economic Fluctuations and Forecasting Homework #5: Answers
Page 3: Economics 470: Economic Fluctuations and …faculty.wwu.edu/kriegj/Course/470 Homework/Hw5ans.docx · Web viewEconomics 470: Economic Fluctuations and Forecasting Homework #5: Answers
Page 4: Economics 470: Economic Fluctuations and …faculty.wwu.edu/kriegj/Course/470 Homework/Hw5ans.docx · Web viewEconomics 470: Economic Fluctuations and Forecasting Homework #5: Answers
Page 5: Economics 470: Economic Fluctuations and …faculty.wwu.edu/kriegj/Course/470 Homework/Hw5ans.docx · Web viewEconomics 470: Economic Fluctuations and Forecasting Homework #5: Answers
Page 6: Economics 470: Economic Fluctuations and …faculty.wwu.edu/kriegj/Course/470 Homework/Hw5ans.docx · Web viewEconomics 470: Economic Fluctuations and Forecasting Homework #5: Answers
Page 7: Economics 470: Economic Fluctuations and …faculty.wwu.edu/kriegj/Course/470 Homework/Hw5ans.docx · Web viewEconomics 470: Economic Fluctuations and Forecasting Homework #5: Answers

2. I have placed two generated time series online (Series A & B). Identify the underlying process that I used to generate each series. Can you estimate the parameters that I used to create each series? If so, forecast the next two values of each series. What are the associated standard errors of your forecast?A: The process I used to generate A was Y t=e

5+.002 t+εt+.8ε t−1−.2 εt−2 where ε˷N(0,.01).In Stata, I would estimate this by doing the following:

/sigma .1023443 109.8429 0.00 0.999 -215.1858 215.3905 L2. -.2745011 589.2292 -0.00 1.000 -1155.143 1154.594 L1. .7254989 2146.526 0.00 1.000 -4206.387 4207.838 ma ARMA _cons 5.075381 .0161369 314.52 0.000 5.043753 5.107009 t .0021243 .0000799 26.59 0.000 .0019678 .0022809lny lny Coef. Std. Err. z P>|z| [95% Conf. Interval] OPG

Log likelihood = 298.438 Prob > chi2 = 0.0000 Wald chi2(3) = 710.83Sample: 1 - 350 Number of obs = 350

ARIMA regression

Iteration 9: log likelihood = 298.43803 Iteration 8: log likelihood = 298.43803 Iteration 7: log likelihood = 298.4379 Iteration 6: log likelihood = 298.39446 Iteration 5: log likelihood = 298.28443 (backed up)(switching optimization to BFGS)Iteration 4: log likelihood = 298.28386 Iteration 3: log likelihood = 298.23452 Iteration 2: log likelihood = 298.04297 Iteration 1: log likelihood = 297.9716 Iteration 0: log likelihood = 297.75343 (setting optimization to BHHH)

. arima lny t, ma(1 2)

. gen lny = log(y)

To get forecasts, I need to find the residuals from periods 349 and 350:

350. .0202459 349. -.0468494 resid

. list resid in 349/350

l̂og (Y 351)=5.075381+.0021243×351+.0468× .2745+.0202× .7254=5.8485Using this, my predicted value of Y351 = e5.8485 = 346.713

l̂og (Y 352)=5.075381+.0021243×352−.0202× .2745+0× .7254=5.8175Using this, my predicted value of Y352 = e5.8175 = 336.16Which is what Stata gives me:

Page 8: Economics 470: Economic Fluctuations and …faculty.wwu.edu/kriegj/Course/470 Homework/Hw5ans.docx · Web viewEconomics 470: Economic Fluctuations and Forecasting Homework #5: Answers

352. 5.81761 351. 5.848482 lyhat

. list lyhat in 351/352

r(111);variable lnyhat not found. list lnyhat in 351/352

. predict lyhat, xb

The forecast variance for the natural log of y is:

352. .0159898 351. .0105042 lymse

. list lymse in 351/352

The 95% C.I. for the natural log forecast is:log(y351) = 5.8484 ± 1.966×.0105.5 = [5.6469, 6.04989]log(y352) = 5.81761 ± 1.966×.0159.5 = [5.569, 6.0662]The corresponding C.I. for Y are [283.41, 431.04] and [262.17, 431.03]

B: The process I used to generate this was:Yt = 10 + εt + .9 εt-1 - .5 εt-2 in 1/500Yt = 2 + .8Yt-1 + εt in 501/1000

where εt ˷ N(0,10).

This process has a structural break between t = 500 and t = 501.I would forecast this by:

/sigma 10.00098 .3346145 29.89 0.000 9.345143 10.65681 L1. .762897 .0301725 25.28 0.000 .7037599 .822034 ar ARMA _cons 10.04236 1.870878 5.37 0.000 6.375505 13.70921y y Coef. Std. Err. z P>|z| [95% Conf. Interval] OPG

Log likelihood = -1861.244 Prob > chi2 = 0.0000 Wald chi2(1) = 639.31Sample: 501 - 1000 Number of obs = 500

ARIMA regression

Iteration 2: log likelihood = -1861.2435 Iteration 1: log likelihood = -1861.2436 Iteration 0: log likelihood = -1861.2513 (setting optimization to BHHH)

. arima y in 501/1000, ar(1)

A correlogram of the residuals in the final 500 periods reveals that there are no statistically significant autocorrelations.

To forecast this, I need to know Y500:

Page 9: Economics 470: Economic Fluctuations and …faculty.wwu.edu/kriegj/Course/470 Homework/Hw5ans.docx · Web viewEconomics 470: Economic Fluctuations and Forecasting Homework #5: Answers

500. 41.4981 y

. list y in 500

My forecast over the next two periods are:Y501 = 2.38107+ .762897×24.67756 = 21.207Y502 = 2.38107+ .762897×21.207= 18.560where 2.38107 = 10.042(1 - .76289)

This is a simple enough model to calculate the forecast variances, however, I will use stata to do so:

1002. 158.232 1001. 100.0195 ymse

. list ymse in 1001/1002

. predict ymse, mse

The confidence intervals areY501 = 21.207 ± 1.96×100.0195.5 = [1.605, 40.808]Y502 = 18.560 ± 1.96×158.232.5 = [-6.09, 43.21]

3. I placed monthly observations of the Washington State unemployment rate from 1976:1 to 2012:12 on my website. Use this data to forecast the Washington unemployment rate for 2013:1. For more information on this data, see: http://research.stlouisfed.org/fred2/series/WAUR/downloaddata?cid=27331I begin by looking at the correlogram of Unem:

40 0.0659 0.0000 6719.9 0.0000 39 0.0797 -0.0577 6717.8 0.0000 38 0.0942 0.0095 6714.7 0.0000 37 0.1096 -0.1208 6710.4 0.0000 36 0.1260 0.0229 6704.5 0.0000 35 0.1434 -0.0410 6696.8 0.0000 34 0.1622 0.0147 6686.9 0.0000 33 0.1820 -0.0065 6674.2 0.0000 32 0.2030 0.0831 6658.2 0.0000 31 0.2250 0.0121 6638.4 0.0000 30 0.2480 -0.0988 6614.1 0.0000 29 0.2719 -0.0384 6584.7 0.0000 28 0.2967 0.0933 6549.4 0.0000 27 0.3225 0.0471 6507.5 0.0000 26 0.3493 0.0394 6458.1 0.0000 25 0.3770 -0.0861 6400.4 0.0000 24 0.4057 0.0453 6333.2 0.0000 23 0.4350 -0.0274 6255.6 0.0000 22 0.4652 0.0791 6166.6 0.0000 21 0.4959 0.1076 6065 0.0000 20 0.5269 0.0163 5949.9 0.0000 19 0.5581 -0.1076 5820.2 0.0000 18 0.5892 -0.0431 5675.1 0.0000 17 0.6201 -0.0669 5513.7 0.0000 16 0.6511 0.0261 5335.3 0.0000 15 0.6818 -0.0152 5139.2 0.0000 14 0.7123 -0.0077 4924.6 0.0000 13 0.7423 -0.0828 4691 0.0000 12 0.7717 0.0931 4437.8 0.0000 11 0.7999 0.0354 4164.8 0.0000 10 0.8271 -0.0770 3872.2 0.0000 9 0.8531 -0.0601 3560 0.0000 8 0.8777 -0.1048 3228.7 0.0000 7 0.9011 -0.0995 2878.8 0.0000 6 0.9228 -0.0418 2510.9 0.0000 5 0.9429 0.1240 2125.9 0.0000 4 0.9608 0.1438 1724.9 0.0000 3 0.9762 -0.2784 1309.4 0.0000 2 0.9884 -0.8067 881.45 0.0000 1 0.9964 0.9965 443.78 0.0000 LAG AC PAC Q Prob>Q [Autocorrelation] [Partial Autocor] -1 0 1 -1 0 1

. corrgram unem

My first guess is that this is an AR(4) process; the autocorrelations slowly die off and the partial autocorrelations die out at the fourth lag. Here’s what I estimate:

Page 10: Economics 470: Economic Fluctuations and …faculty.wwu.edu/kriegj/Course/470 Homework/Hw5ans.docx · Web viewEconomics 470: Economic Fluctuations and Forecasting Homework #5: Answers

/sigma .0765849 .0022634 33.84 0.000 .0721487 .081021 L4. .1430485 .0433462 3.30 0.001 .0580914 .2280055 L3. -.5041862 .0885065 -5.70 0.000 -.6776558 -.3307165 L2. -.2585794 .0902554 -2.86 0.004 -.4354768 -.081682 L1. 1.614073 .0398421 40.51 0.000 1.535984 1.692163 ar ARMA _cons 7.190855 .6290152 11.43 0.000 5.958008 8.423702unem unem Coef. Std. Err. z P>|z| [95% Conf. Interval] OPG

Log likelihood = 507.0038 Prob > chi2 = 0.0000 Wald chi2(4) = 235101.92Sample: 1976m1 - 2012m12 Number of obs = 444

ARIMA regression

Iteration 8: log likelihood = 507.00378 Iteration 7: log likelihood = 507.00377 Iteration 6: log likelihood = 507.0035 Iteration 5: log likelihood = 506.99055 (switching optimization to BFGS)Iteration 4: log likelihood = 506.9551 Iteration 3: log likelihood = 506.73062 Iteration 2: log likelihood = 504.85613 Iteration 1: log likelihood = 487.409 Iteration 0: log likelihood = 250.97679 (setting optimization to BHHH)

. arima unem, ar(1/4)

The residuals from this appear to be white noise:

40 -0.0104 0.0027 22.377 0.9890 39 0.0390 0.0451 22.324 0.9852 38 -0.0041 -0.0060 21.58 0.9852 37 -0.0245 -0.0349 21.572 0.9798 36 0.0200 0.0343 21.281 0.9755 35 -0.0797 -0.0763 21.086 0.9694 34 -0.0086 -0.0089 18.011 0.9888 33 -0.0268 -0.0183 17.976 0.9844 32 0.0276 0.0256 17.629 0.9814 31 -0.0415 -0.0536 17.263 0.9779 30 0.0153 0.0290 16.439 0.9787 29 0.0413 0.0608 16.327 0.9716 28 -0.0054 -0.0282 15.513 0.9725 27 -0.0179 -0.0402 15.499 0.9618 26 -0.0068 0.0140 15.347 0.9507 25 0.0126 0.0271 15.325 0.9335 24 0.0427 0.0517 15.25 0.9132 23 -0.0406 -0.0345 14.39 0.9151 22 -0.0158 -0.0318 13.617 0.9145 21 0.0063 -0.0355 13.499 0.8901 20 -0.0362 -0.0408 13.48 0.8558 19 0.0235 0.0260 12.869 0.8452 18 0.0602 0.0685 12.611 0.8141 17 -0.0688 -0.0575 10.926 0.8604 16 -0.0122 0.0047 8.7322 0.9240 15 -0.0230 -0.0362 8.6628 0.8945 14 -0.0326 -0.0330 8.4196 0.8663 13 -0.0089 -0.0117 7.9301 0.8481 12 0.0786 0.0606 7.8933 0.7934 11 -0.0073 -0.0124 5.0626 0.9281 10 0.0376 0.0484 5.0385 0.8886 9 0.0524 0.0629 4.3942 0.8836 8 -0.0377 -0.0365 3.1465 0.9248 7 -0.0201 -0.0086 2.5003 0.9271 6 -0.0146 -0.0184 2.3173 0.8883 5 0.0044 -0.0028 2.2212 0.8178 4 -0.0438 -0.0449 2.2125 0.6967 3 0.0490 0.0524 1.3501 0.7173 2 0.0239 0.0249 .2718 0.8729 1 -0.0059 -0.0062 .01533 0.9015 LAG AC PAC Q Prob>Q [Autocorrelation] [Partial Autocor] -1 0 1 -1 0 1

. corrgram resid

. predict resid, resid

Thus, I conclude this is an AR(4) process.