0% found this document useful (0 votes)
14 views7 pages

Hw2 TSA

The document discusses time series analysis of daily crude oil prices from 2000 to 2022. Various AR and MA models were fitted to the return series and their residuals were checked. The optimal AR model was identified as AR(18) but was overfitted. The refined AR model with significant coefficients had better fit statistics and residual checks. Forecasts for the next 4 days were generated from the refined model along with confidence intervals.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views7 pages

Hw2 TSA

The document discusses time series analysis of daily crude oil prices from 2000 to 2022. Various AR and MA models were fitted to the return series and their residuals were checked. The optimal AR model was identified as AR(18) but was overfitted. The refined AR model with significant coefficients had better fit statistics and residual checks. Forecasts for the next 4 days were generated from the refined model along with confidence intervals.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Time Series Analysis

Homework 2
1. (Commodity price) Consider the daily crude oil prices BRENT in Europe in U.S. dollars per barrel
from January 3, 2000 to October 3, 2022. The data can be obtained from FRED using the quantmod
package. Since there are some missing values, we need to remove them before analysis.
(a) Obtain the time plots of xt and rt (in one page, using the command par(mfcol=c(2,1)). In other
words, obtain 2 plots in one window (time plots for xt and rt).

(b) Let rt = 100*(xt – xt-1) be the return series of the gold prices, in percentages. Consider the r t series.
Test H0 : 1 = ... = 12 = 0 versus Ha : i  0 for some 1 ≤ i ≤ 12. Draw your conclusion.

Statistical analysis using the Box-Ljung test suggest that at 5% significance level, the null
hypothesis can be rejected. Thus, there is a significant serial autocorrelation among return series of
the daily crude oil prices in the past 12 months.

(c) Use the command ar(rt,method="mle",order.max=20) to specify the order of an AR model for r t.

An AR(18) is identified.

The order with the minimum AIC which is found to be 18 is chosen as the optimal order for the
AR model. The plot below visually shows the AIC values for orders 0 to 20, highlighting the
preference for the lower-order model (order k that has the minimum AIC value).
(d) Build an AR model for rt, including model checking.

The AR(18) model was employed for the data and the fitted model is:

x t=0.0205+0.0172 xt −1−0.0248 x t−2 +0.0163 x t−3 +0.0164 x t −4−0.0029 x t −5−0.0100 x t−6−0.002 x t −7 + 0.0347 x t −
, σ 2 = 7.063, σ^ a=2.658 , AIC=27732.88,

Considering the residual series of the fitted AR(18) model for the r t we have Q = 0.877 with p-value
0.645. This indicates that the null hypothesis of no residual serial correlation is not rejected at the
5% level. The model is adequate in modeling the linear dependence of the data. However, based on
the time series diagnostic plot it can also be concluded that the model is overfitted.

tstatistic
coefficients standard_errors
s
ar1 -0.017 0.013 -1.309
ar2 -0.025 0.013 -1.885
ar3 0.016 0.013 1.241
ar4 0.016 0.013 1.250
ar5 -0.003 0.013 -0.217
ar6 -0.010 0.013 -0.763
ar7 -0.002 0.013 -0.180
ar8 0.035 0.013 2.650
ar9 0.038 0.013 2.886
ar10 -0.047 0.013 -3.609
ar11 -0.028 0.013 -2.155
ar12 0.041 0.013 3.100
ar13 0.081 0.013 6.159
ar14 0.035 0.013 2.684
ar15 0.011 0.013 0.826
ar16 0.015 0.013 1.160
ar17 -0.005 0.013 -0.398
ar18 -0.041 0.013 -3.095
intercept 0.023 0.039 0.583

(e) Refine the model by excluding all estimates with t-ratio less than 1.96. Write down the fitted model.
Hint: Remove estimates with t-ratio less than 1.96 and re-estimate the AR model.

The refined model is:

x t=0.0205+0.0358 x t−8 +0.0364 x t −9−0.0493 x t−10−0.0274 xt −11 +0.0441 x t−12+ 0.0803 x t −13+ 0.0304 x t−14−0.
, σ 2¿ 7.077 , σ^ a=2.660 , AIC=27724.21

coefficients standard_errors tstatistics


ar2 0.036 0.013 2.735
ar8 0.036 0.013 2.783
ar9 -0.049 0.013 -3.769
ar10 -0.027 0.013 -2.099
ar11 0.044 0.013 3.372
ar12 0.080 0.013 6.142
ar13 0.030 0.013 2.330
ar14 0.036 0.013 2.735
ar18 -0.041 0.013 -3.155
intercept 0.023 0.039 0.584

(f) Perform tsdiag(model,gof=20) for your new fitted model and compare with (e). Provide the plots.

The refined model keeps the adequacy and provides a better fit according to the Box-Ljung test and
lower AIC value. The residual series gives Q = 11.834 with p-value 0.459 indicating that the null
hypothesis of no residual serial correlation is not rejected at the 5% level.

(g) Use the fitted AR model to compute 1-step to 4-step ahead forecasts of r t at the forecast origin
October 3, 2022. Also, compute the corresponding 95% interval forecasts.

Since the refined model is a more suitable choice for representing the linear dependence in the data, it
was used for computing the forecasts and corresponding CI. The forecasted values along with their
standard errors are presented in the table below.

Step 1 2 3 4
Forecast 0.100 -0.562 -0.611 0.373
Standard Error 2.660 2.660 2.660 2.660
Lower CI Upper CI Predicted Value
-5.114 5.314 0.100
-5.776 4.653 -0.562
-5.826 4.603 -0.611
-4.841 5.587 0.373

2. (Model comparison) Consider, again, the log return series of gold price of Problem 1.

(a) Build MA(10) and MA(13) models for rt. You do not need to write down the fitted model, however,
please provide the estimated coefficients. Note: You may provide the R output for this section using
copy-and-paste.

MA(10):

MA(13):

The examination of both model results shows the evidence of serial correlation in residuals. The MA(10)
model exhibits a Q = 74.937 with a p-value  0.01, indicating a presence of serial correlation. Similarly,
the MA(13) model shows a Q=18.833 with a p-value  0.01, further supporting the presence of serial
correlation. Thus, the model must be refined.

(b) Discuss what you observe in (a). Does each model need to be refined? For example, do coefficient
estimates have t-ratios less than 1.96?

Looking at the results tables for MA(10) and MA(13), it is evident that the coefficient estimates in both
tables have t-ratios less than 1.96. This observation suggests that the models require refinement, as the
coefficients lack statistical significance. (The diagnostics plots: MA(10) on the left, MA(13) on the
right)

coefficients standard_errors tstatistics


MA(10)
ma1 -0.013 0.013 -0.991
ma2 -0.022 0.013 -1.644
ma3 0.020 0.013 1.522
ma4 0.013 0.014 0.983
ma5 -0.012 0.013 -0.920
ma6 -0.012 0.013 -0.969
ma7 0.001 0.013 0.107
ma8 0.035 0.013 2.625
ma9 0.035 0.014 2.442
ma10 -0.050 0.014 -3.698
intercept 0.023 0.035 0.658
MA(13)
ma1 -0.019 0.013 -1.426
ma2 -0.026 0.013 -2.013
ma3 0.016 0.013 1.186
ma4 0.016 0.013 1.245
ma5 0.000 0.013 -0.001
ma6 -0.007 0.013 -0.537
ma7 -0.003 0.013 -0.208
ma8 0.034 0.013 2.658
ma9 0.035 0.014 2.588
ma10 -0.050 0.013 -3.821
ma11 -0.034 0.013 -2.600
ma12 0.048 0.013 3.807
ma13 0.079 0.013 6.195
intercept 0.023 0.038 0.604
(c) After refining models, perform model checking for MA(10) and MA(13) using
tsdiag(model,gof=20). What do you observe? Provide the plots for each model and explain what
you observe in each plot. →Discuss your thoughts on how residual plot, ACF of residual, and p-
values for Ljung- Box test look like.
Considering the residual series of the fitted MA(10) model and MA(13) models for the r t we have Q =
84.494 with p-value  0.01 and Q = 22.82 with p-value 0.04, respectively. This indicates that for the fitted
MA(10) mode, the null hypothesis of no residual serial correlation is still rejected at the 5%. However, for
the fitted MA(13) model, the null hypothesis of no residual serial correlation is barely not rejected at the
5% level. This implies that the residual series of the MA(10) model still exhibits significant serial
correlation, while the MA(13) model is only marginally inadequate. Thus, both fitted models are not
found to be a suitable choice, and it is recommended to explore alternative models for a better
representation of the data. The diagnostic plots, with MA(10) on the left and MA(13) on the right, are
presented below.

You might also like