R语言 经济金融代写

1. Download the dataset “Ohanian_HW1” from the course website. There are 200 observations.

(A) Plot the data, and label this as Ögure 1. Do you think that the data are stationary? If so, why do you think that?

(B) Estimate an AR(1) model for data points 1-150. You decide whether you wish to include a constant term or not. Show the parameter estimate(s), and their standard errors of the coe¢ cients. Test whether the coe¢ cient(s) are signiÖcantly di§erent from 0 using a 5 percent test statistic.

(C) Then, use the estimated model to make a one-period forecast for the remaining 50 observations (observations 151-200). Calculate the root mean square error of the one-period forecasts. (Note that as you make each one-step forecast that you update the actual data that you use by one period).

(D) Repeat parts (B) and (C) using an AR(2) model. Which model gen- erates better forecasts in terms of root mean square error? Why?

2. Go to the following link: https://fred.stlouisfed.org/series/GDP

Download the US GDP data from 1950:1 up to 2018:3.
Take logs of the data, and plot the data. Then conduct the following analysis

for both di§erencing and linear detrending:

(A) Estimate an AR model that you choose to the log-di§erenced data. Show the coe¢ cient estimate(s) and standard errors of the coe¢ cients. Estimate the model up through 2010:4. Then calculate one-period ahead forecasts from 2011:1 to 2018:3. Then, using these forecasts of log-di§erenced data, construct one-period ahead forecasts of the level of real GDP. Plot the level of real GDP and your one-period forecasts. Calculate root mean square forecast error of the level of real GDP.

1

(B) Repeat the analysis in number 1, but instead of taking log-di§erenced data, linearly detrend the logged data using a constant term and time.

(C) Which method produced better forecasts? Why do you think this is the case?

2