Assignment 2
STAT317/ECON323
Due 5pm Tuesday, 14 September 2021
A reminder that graphs help in interpretation and explanation and you are expected to present them properly.
1
a
b c
d
Question 1 – 9 Marks
Using one of the time series options from assignment #1 – you can use the same one or a different one – do the decomposition of the time series using the stl command. Comment on the the three components.
Using stl command specify t.window = 5. How are your graphical out- puts different? Why (hint: what does t.window option do)?
Using the same command as for part a. do the decomposition of the logged series using the stl command. Comment on the the three com- ponents. Are the shape or characteristics – the values of course will be different – of any of the three components different from those from the previous decomposition? Or do they look similar? Explain why a compo- nent differs or remains the similar.
From the two decompositions would you model the whole series or just part? Justify you conclusions.
1
2 Question 2 – 16 Marks
Using the same time series you are asked to do a time series regression. You can use either the lm() function or the tslm() function from the forecast package (recommended).
a Fit the simple regression model yt = β0 + β1t + εt, t = 1,…,N to this data. From your outputs write the fitted model yt = βˆ0 + βˆ1t + εt with values for the parameters and residuals.
b Using various graphical displays of the residuals (e.g. time series, ACF, Normal Distribution) show and explain why the residuals are what you would expect from a fitted time series model.
c Fit the regression model yt = β0 + β1t + 11 δjDjt + εt, where Djt is j=1
the estimate for seasonal dummy for months j = 1, 2, . . . , 11. Again from your outputs write the fitted model yt = βˆ0 + βˆ1t + 11 δjDˆjt + εt.
j=1 d What is your estimate for Dˆ12t? Show your working.
e Compare the graphs of residuals from this model to those from the pre- vious model. What are the differences, if any, and explain why this is so?
f Fit the regression model log(yt) = β0 +β1t+11 δjDjt +εt, where Djt is j=1
the seasonal dummy for months J = 1, 2, . . . , 11. Again from your outputs write the fitted model log(yt) = βˆ0 + βˆ1t + 11 δjDˆjt + εt along with
j=1
your estimate for Dˆ12t.
g Compare the residuals from this model to those from the previous two
models. What are the differences, if any, and explain why this is so?
2