13.08.2022 Views

advanced-algorithmic-trading

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

122

Figure 10.16: Residuals of MA(1) Model Fitted to S&P500 Daily Log Prices

-0.1189 -0.0524 2e-04

s.e. 0.0216 0.0223 2e-04

sigma^2 estimated as 0.0001839: log likelihood = 6252.96, aic = -12497.92

Once again we can make a plot of the residuals of this fitted MA(2) model as given in Figure

10.17.

> acf(gspcrt.ma$res[-1])

While the peak at k = 2 has disappeared (as we would expect) we are still left with the

significant peaks at many longer lags in the residuals. Once again we find the MA(2) model is

not a good fit.

We should expect for the MA(3) model to see less serial correlation at k = 3 than for the

MA(2). We should also expect no reduction in further lags.

> gspcrt.ma <- arima(gspcrt, order=c(0, 0, 3))

> gspcrt.ma

Call:

arima(x = gspcrt, order = c(0, 0, 3))

Coefficients:

ma1 ma2 ma3 intercept

-0.1189 -0.0529 0.0289 2e-04

s.e. 0.0214 0.0222 0.0211 3e-04

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!