Вы находитесь на странице: 1из 4

Homework 2, MMA702 Time series analysis

Anatoliy Malyarenko
14th April 2015

Notes
 Use 5% level in all tests.
 The notation i is the lag-i autocorrelation coefficient.
 In some of the problems, I provide guidance to specify a time series model. This is to
help you gain experience in empirical data analysis. You can try your own models to
gain further experience. The assignments show that multiple models can fit a given data
set well and seasonally adjusted data might still have some residual seasonality.

Assignments
1. Consider the monthly series of Consumer Sentiment of the University of Michigan.
This survey series is widely used to indicate the consumer confidence about the U.S.
economy. The data are available from FRED of the Federal Reserve Bank of St. Louis
and also in the file m-umcsent.txt. The sample period is from January 1978 to
August 2013.
a) Plot the monthly consumer sentiment series.
b) Is there a unit root in the monthly sentiment series? Why?
c) Consider the change series of the sentiment, i.e. the first differenced data. Test the
hypothesis that the expected change of the sentiment is zero versus the alternative that
the expected change is non-zero.
d) Focus on the change series. Test the null hypothesis H0 W 1 D 2 D    D 12 D 0
versus the alternative Ha W i 0 for some i 2 Z \ 1; 12. Draw your conclusion.
2. Again, consider the change series of consumer sentiment of Problem 1.
a) Use the command ar with method mle to find the order.
b) Build an AR model based on the selected order for the change series. Perform model
checking to validate the fitted model. Write down the model.

c) Does the model imply the existence of business cycles in consumer sentiment? Why?
d) Obtain 1-step to 4-step ahead point and 95% interval forecasts for the change series
of consumer sentiment at the forecast origin August 1, 2013 (the last data point).
3. Consider, again, the monthly change series of consumer sentiment of Problem 1.
a) Simplify the fitted AR model of Problem 2 by removing parameter estimates with
t-ratio less than 1:2 in absolute value. [Use parameter fixed.]
b) Is the model adequate? Why?
c) Compare the simplified model with the AR model built in Problem 2. In terms of
in-sample fitting, which model is preferred? Why?
d) Does the simplified model imply the existence of business cycles? Why?
e) Use backtest to compare the two AR models. You may start the forecast origin at
t D 380. Which model is preferred? Why?
4. Unemployment rate is an important macroeconomic series. Equivalent importance is
the duration of unemployment. Consider the mean duration of unemployment is the
U.S. from January 1948 to March 2014. The duration is measured in weeks. The data
are available from FRED of the Federal Reserve Bank of St Louis and also in the file
m-unempmean.txt. The data were seasonally adjusted.
a) Does the mean duration series have a unit root? Why?
b) Focus on the change series of duration, i.e. the first differenced series. Denote the
change series by r t and let Er t D . Test H0 W  D 0 versus the alternative Ha W  0.
Draw your conclusion.
c) Build an AR model for r t series. Perform model checking using gof=24. Is the
model adequate? Why?
d) Write down the fitted AR model.
e) Fit a seasonal model for the r t series using the command
ms=arima(rt,order=c(2,0,1),seasonal=list(order=c(1,0,1),
period=12),include.mean=F)
(dont forget to type it in one line!) Perform model checking using gof=24. Is the
seasonal model adequate? Why?
f) Based on the in-sample fitting, which model is preferred? Why?
g) Consider out-of-sample predictions. Use t D 750 as the starting forecast origin.
Which model is preferred based on the out-of-sample predictions?
5. (Commodity prices). Consider the weekly crude oil prices: West Texas Intermediate
(WTI), Cushing, Oklahoma. The data are also available from FRED and in the file
w-coilwtico.txt. The sample period is from January 3, 1986 to April 2, 2014.

a) Let r t be the growth series, i.e. the first difference of log oil prices. Is there serial
correlation in the r t series? You may use Q(10) to draw the conclusion.
b) Build an AR model for r t . Check the adequacy of the model, and write down the
model.
c) Fit another model to r t using the following command
m5=arima(rt,order=c(3,0,2),include.mean=F)
This is an ARIMA(3,0,2) model. Write down the model. Based on in-sample fitting,
which model is preferred?

Hints
1. a) Use R commands read.table, head, and plot.
b) Perform unit-root tests. Load the package fUnitRoots. Use three augmented
DickeyFuller tests with various options concerning the deterministic component. The
name of the R function is adfTest. The first argument is the name of the time
series variable. Use the second argument lags=5. The third argument can be either
type="c" (constant), type="nc" (no constant), or type="ct" (time trend).
c) Use R commands diff and t.test.
d) Use R command Box.test with parameter type=Ljung.
2. b) To build a model, use R command arima with parameter include.mean=F. To
check the model, use R command tsdiag.
c) Form the vector containing the coefficients of the characteristic polynomial, using R
command c. Find its zeroes using R command polyroot. Draw your conclusion.
d) Use R command predict and material of Lecture 3.
3. b) Use R command tsdiag.
c) The model with the smaller value of the AIC criterion is preferred.
d) Run R command source("backtest.R"). Call backtest for each model.
The model with less values of RMSE and MAE is preferred.
4. a) To determine the number of lags in the augmented DickeyFuller test, find the order
of the AR model for the first differenced data.
b) Use R command t.test.
c) Use R command arima and tsdiag with gof=24.
f) The model with the smaller value of the AIC criterion is preferred.
g) The model with less values of RMSE and MAE is preferred. Do not pay attention to
eventual warning messages.

5. a) Use R commands read.table, head, log, diff. To find the correct value
for the parameter include.mean, run t.test. Run R command Box.test with
parameter type=Ljung.
b) Use R commands ar, arima, and tsdiag. Simplify the fitted AR model removing
parameter estimates with t -ratio less than 1:2 in absolute value.
c) The model with the smaller value of the AIC criterion is preferred.

Вам также может понравиться