程序代写案例-STAT4102/STAT8002-Assignment 2
时间:2022-05-07
RESEARCH SCHOOL OF FINANCE, ACTUARIAL STUDIES AND STATISTICS
APPLIED TIME SERIES ANALYSIS
STAT4102/STAT8002
Assignment 2 (Total Marks: 85)
Submit by 5pm Tuesday 10 May 2022
INSTRUCTIONS:
• This assignment is worth 25% of your overall marks for this course.
• The assignment can be typed or handwritten. It should be completed on your own. If
you copy someone else’s work or allow your work to be copied, you will receive a mark
of zero for the assignment and risk very severe academic consequences.
• Your assignment should be submitted to Turnitin as a single pdf document (less than
50MB) including the following:
1. The assignment cover sheet (available to download from Wattle).
2. Your assignment.
Please be aware of the quality and the size of your file when you are preparing the
submission.
• For R related questions, you need to include both R commands and corresponding R
output.
• Include all working, as marks will not be awarded for solutions that do not include
working.
• Name your assignment “Course code_Uid”, e.g., “STAT8002_u1234567”.
• Marks will be deducted if above instructions are not strictly adhered to.
• Try to submit your assignment at least 15 mins before the deadline in case something
unexpected happens, for instance internet issue.
• Late submissions will NOT be accepted. Extensions will usually be granted on med-
ical or compassionate grounds on production of appropriate evidence, but must have
lecturer’s permission at least 24 hours before the deadline.
Assignment 1 - Sem 1, 2022 Page 1 of 4
Question 1 [10 Marks]
Check if the following ARMA models are causal and/or invertible and justify your
answers.
(a) [3 marks] zt = 5 + 0.9zt−1 + 0.8wt−1 + wt, where wt ∼WN(0, σ2w).
(b) [3 marks] yt = 0.8yt−1− 0.15yt−2+wt− 2.3wt−1+0.6wt−2, where wt ∼WN(0, σ2w).
(c) [4 marks] zt = −5 + 2.5zt−1 − zt−2 + wt − 2wt−1, where wt ∼WN(0, σ2w).
Question 2 [45 Marks]
Consider an invertible process xt = wt + θswt−s + θ2swt−2s, where wt ∼WN(0, σ2w) and
s is a positive integer.
(a) [5 marks] Express the ACOF and ACF of xt as a function of θs, θ2s, σ2w, for h =
0,±1,±2, · · · . Summarize the pattern of ACF for h > 0.
When s = 2, the model becomes xt = wt + θ2wt−2 + θ4wt−4, where wt ∼ WN(0, σ2w).
Please answer part (b)-(f) based on this model.
(b) [8 marks] Derive the invertible form of xt.
(c) [10 marks] Suppose we have data x1, · · · , xT . Please derive the expression of the
conditional log-likelihood function of parameters θ2, θ4 and σ2w given w0 = 0, w−1 =
0, w−2 = 0, w−3 = 0. If we would like to use the minimum CSS estimation, what is
the appropriate expression of CSS function Sc(θ1, θ2) such that the minimum CSS
estimation is equivalent to the conditional MLE? (No need to prove the equiva-
lence.)
(d) [8 marks] Derive the PACF of xt at lag 2, 3 and 4 and express them as functions
of θ2 and θ4.
(e) [8 marks] Derive the one-step-ahead forecast of x5 based on x1, x2, x3 and x4, and
express the forecast as a function of θ2 and θ4. Calculate its mean squared prediction
error and only need to express it as a function of ACOF/ACF.
(f) [6 marks] Let x˜t|t−1 be the truncated one-step-forecast of xt based on data x1, · · · , xt−1
for t = 2, · · · , T . Also let x˜1|0 = 0, meaning that when there are no data, we use
the stationary mean zero to predict x1.
Let w˜t|t−1 = xt − x˜t|t−1, which is called the in-sample prediction error of x˜t|t−1,
t = 1, · · · , T . Define the sum of squared in-sample prediction errors as
SSE =
T∑
t=1
w˜2t|t−1.
Assignment 1 - Sem 1, 2022 Page 2 of 4
Express SSE as a function of θ2 and θ4. Compare SSE with the result of Sc(θ2, θ4)
derived in part (c) and summarize your findings.
Question 3 [30 Marks]
Dataset robot is stored in the R library TSA. This dataset contains a time series obtained
from an industrial robot. The robot was put through a sequence of maneuvers, and the
distance from a desired ending point was recorded in inches. This was repeated 324
times to form the time series.
(a) [1 mark] Display the time series plot of the data and comment on its appearance.
We decide to partition the dataset into a training dataset (the first 300 observations):
{zt : t = 1, · · · , 300} and a validation dataset (the last 24 observations): {zt, t =
301, · · · , 324).
(b) [2 marks] Based on the training dataset, choose an appropriate ARMA model by
the information of its SACF, SPACF and SEACF. Note that an AR or MA model
can be considered as an ARMA model.
(c) [7 marks] Based on the chosen model in part (b), use MLE and CSS to fit the
model, respectively and then test the significance of the coefficients. Compare the
results. For the one fitted by MLE, do the model diagnostics and normality check.
Comment on the results.
(d) [6 marks] Based on the training dataset, what are the top two ARMA models with
the smallest AIC, except for the one selected in part (b)? Please set pmax = 5 and
qmax = 5. Fit the selected models, test the significance of the coefficients, do the
model diagnostics and normality check. Comment on the results.
(e) [3 marks] We would like to use the validation dataset to assess the performance
of the three candidate models: the model fitted by MLE in part (c) and the two
models selected in part (d). For each candidate model, calculate the root mean
squared prediction error and compare the results. The root mean square error is
defined as follows
RMSE =
√∑24
m=1(z300+m − z˜300+m|300)2
24
where z˜300+m|300 is the truncated m-step-ahead forecast of z300+m by using the
observations {zt, t = 1, · · · , 300} in the training dataset.
(f) [3 marks] Based on the analyses in part (b)-part(e), which model is more preferred
to be the final model and why?
(g) [8 marks] In practice, moving-window out-of-sample forecasts are often used to
predict future observations. The steps to obtain moving-window out-of-sample
Assignment 1 - Sem 1, 2022 Page 3 of 4
forecasts are illustrated as follows:
Suppose we have data {zt, t = 1, · · · , T} and want to predict B future observations
{zT+b, b = 1, · · · , B}.
b = 1: Use the original data set {zt, t = 1, · · · , T} to fit the model and obtain the
truncated one-step-ahead forecast for zT+1, denoted as z˜T+1|T .
b = 2: Create a new dataset {z1, · · · , zT , z˜T+1|T}. Then based on the new dataset
to fit the model and obtain the truncated one-step-ahead forecast for zT+2, denoted
as z˜T+2|T+1.
b = 3: Create a new dataset {z1, · · · , zT , z˜T+1|T , zT+2|T+1}. Then based on the new
dataset to fit the model and obtain the truncated one-step-ahead forecast for zT+3,
denoted as z˜T+3|T+2.
...
b = B: Create a new dataset {z1, · · · , zT , z˜T+1|T , · · · , zT+B−1|T+B−2}. Then based
on the new dataset to fit the model and obtain the truncated one-step-ahead forecast
for zT+B, denoted as z˜T+B|T+B−1.
Based on the whole 324 observations and the final model chosen in part (f), obtain
the moving-window out-of-sample forecasts for z324+j, j = 1, · · · , 12 as well as the
corresponding prediction intervals. Use an appropriate plot to present the forecasts
and the intervals.
Assignment 1 - Sem 1, 2022 Page 4 of 4


essay、essay代写