13.08.2022 Views

advanced-algorithmic-trading

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

134

Notice that there are some significant peaks, especially at higher lags. This is indicative of a

poor fit. Let us perform a Ljung-Box test to see if we have statistical evidence for this:

> Box.test(resid(spfinal.arma), lag=20, type="Ljung-Box")

Box-Ljung test

data: resid(spfinal.arma)

X-squared = 37.1912, df = 20, p-value = 0.0111

As we suspected the p-value is less than 0.05 and thus we cannot say that the residuals are

a realisation of discrete white noise. Hence there is additional autocorrelation in the residuals

that is not explained by the fitted ARMA(3,3) model.

10.7 Next Steps

As we have discussed all along in this part of the book we have seen evidence of conditional

heteroskedasticity (volatility clustering) in the S&P500 series, especially in the periods around

2007-2008. When we use a GARCH model in the next chapter we will see how to eliminate these

autocorrelations.

In practice, ARMA models are never generally good fits for log equities returns. We need

to take into account the conditional heteroskedasticity and use a combination of ARIMA and

GARCH. The next chapter will consider ARIMA and show how the "Integrated" component

differs from the ARMA model we have been considering in this chapter.

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

Saved successfully!

Ooh no, something went wrong!