# MATLAB代写 | EMET3007/8012 Assignment 2

### MATLAB代写 | EMET3007/8012 Assignment 2

MATLAB数据预测

EMET3007/8012 Assignment 2
Instructions: This assignment is worth either 20% or 25% of the final grade, and is worth a total of 65 points. All working must be shown for all questions. For questions which ask you to write a program, you must provide the code you used. If you have found code and then modified it, then the original source must be cited. The assignment is due by 5pm Monday 30th of September (Monday of Week 9), using Turnitin on Wattle. Late submissions will only be accepted with prior written approval. Good luck.
Question 1: [10 marks] In this exercise we will consider four differ- ent specifications for forecasting monthly Australian total retail sales. The dataset (available on Wattle) AUSRetail.csv contains three columns; the first column contains the date; the second contains the sales figures for that month, and the third contains Australian GDP for that month.1 The data runs from January 1992 to May 2019.
Let Mit be a dummy variable that denotes the month of the year. Let Dit be a dummy variable which denotes the quarter of the year, as in the lecture notes. The four specifications we consider are
S1 : yt = a0 + a1t + α4D4t + εt
4
S2 :yt =a1t+∑αiDit+εt
i=1
S3 :yt =a0+a1t+β12M12,t+εt
12
S4 :yt =a1t+∑βiMit+εt
i=1
where Eεt = 0 for all t.
1The Australian GDP data is very unreliable. Monthly Australian GDP data is hard to come by, so this is quarterly data which I have made monthly by assuming smooth transition between quarters. This data is fine for this assignment, but cannot be used for any other purpose.
1

a) For each specification, describe this specification in words.
b) For each specification, estimate the values of the parameters, and compute the MSE, AIC, and BIC. If you make any changes to the csv file, please describe the changes you make. As always, you must include your code.
c) For each specification, compute the MSFE for the 1-step and 3-step ahead forecasts, with the out-of-sample forecasting exercise begin- ning at T0 = 50.
d) Foreachspecification,plottheout-of-sampleforecastsandcomment on the results.
Question 2: [10 marks] Now add to Question 1 the additional assump- tion that εt ∼ N (0, σ2). One estimator for σ2 is
21T2 σˆ =T−1∑(yt−yˆt)
t=1
where yˆt is the estimated value of yt in the model.
a) Foreachspecification(S1,…,S4),computeσˆ2.
b) For each specification, make a 95% probability forecast for the sales
in December 2019.
i) compute the probability that the retail sales in December 2019 will be greater than 35 billion dollars, given the data comes from FRED series AUSSLRTTO02STM.
ii) compute the probability that the retail sales index in December 2019 will be greater than 105.
d) Do you think the assumption that εt is iid is a reasonable assumption for this data series.
2

Question 3: [10 marks] Here we investigate whether adding GDP as a predictor can improve our forecasts. Consider the following modified specifications:
S1′ : yt = a0 +a1t+α4D4t +γxt−h +εt
4
S 2′ : y t = a 1 t + ∑ α i D i t + γ x t − h + ε t
i=1
S3′ : yt = a0 +a1t+β12M12,t +γxt−h +εt
12
S 4′ : y t = a 1 t + ∑ β i M i t + γ x t − h + ε t
i=1
whereEεt =0forallt,andxt−h isGDPattimet−h.Foreachspecifi- cation, compute the MSFE for the 1-step ahead, and the 3-step ahead fore- casts, with the out-of-sample forecasting exercise beginning at T0 = 50. For each specification, plot the out-of-sample forecasts and comment on the results.
Question 4: [15 marks] Here we investigate whether Holt-Winters smooth- ing can improve our forecasts. Use a Holt-Winters smoothing method with seasonality, to produce 1-step ahead and 3-step ahead forecasts and com- pute the MSFE for these forecasts. You should use smoothing parame- ters α = β = γ = 0.3 and start the out-of-sample forecasting exercise at
T0 = 50. Plot these out-of-sample forecasts and comment on the results.
Additionally, estimate the values for α, β, and γ which minimise the MSFE. Find the MSFE for these parameter vales and compare it to the baseline α = β = γ = 0.3.
Question 5: [5 marks] Questions 1, 3 and 4 each provided alternative models for forecasting US Retail Sales. Compare the efficacy of these fore- casts. In your comparison you should include discussions of MSFE, but should also make qualitative observations.
3

Question 6: [15 marks] Consider the AR(2) process with drift yt = μ+ρ1yt−1 +ρ2yt−2 +εt
where the errors follow an AR(1) process
εt = φεt−1 +ut, ut ∼ N(0,σ2)
for t = 1,…,T and u0 = 0. That is, yt is a noisy signal of an inherently random AR(2) process, with drift. Suppose φ is known. Find (analytically) the maximum likelihood estimators for μ, ρ1, ρ2, and σ2.
[Hint: First write y and ε in vector/matrix form. You may wish to use different looking forms for each. Find the distribution of ε and y. Then apply some appropriate calculus.]
4