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.

138

Figure 11.1: Plot of simulated ARIMA(1,1,1) model with α = 0.6 and β = −0.5

Call:

arima(x = x, order = c(1, 1, 1))

Coefficients:

ar1 ma1

0.6470 -0.5165

s.e. 0.1065 0.1189

sigma^2 estimated as 1.027: log likelihood = -1432.09, aic = 2870.18

The confidence intervals are calculated as:

> 0.6470 + c(-1.96, 1.96)*0.1065

[1] 0.43826 0.85574

> -0.5165 + c(-1.96, 1.96)*0.1189

[1] -0.749544 -0.283456

Both parameter estimates fall within the confidence intervals and are close to the true parameter

values of the simulated ARIMA series. Hence we should not be surprised to see the

residuals looking like a realisation of discrete white noise as given in Figure 11.2.

> acf(resid(x.arima))

Finally, we can run a Ljung-Box test to provide statistical evidence of a good fit:

> Box.test(resid(x.arima), lag=20, type="Ljung-Box")

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

Saved successfully!

Ooh no, something went wrong!