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.

129

> plot(x)

The output of our ARMA(2,2) model is given in Figure 10.21.

Figure 10.21: Realisation of an ARMA(2,2) Model, with α 1 = 0.5, α 2 = −0.25, β 1 = 0.5 and

β 2 = −0.3

And the corresponding autocorelation, as given in Figure 10.22.

> acf(x)

We can now try fitting an ARMA(2,2) model to the data:

> arima(x, order=c(2, 0, 2))

Call:

arima(x = x, order = c(2, 0, 2))

Coefficients:

ar1 ar2 ma1 ma2 intercept

0.6529 -0.2291 0.3191 -0.5522 -0.0290

s.e. 0.0802 0.0346 0.0792 0.0771 0.0434

sigma^2 estimated as 1.06: log likelihood = -1449.16, aic = 2910.32

We can also calculate the confidence intervals for each parameter:

> 0.653 + c(-1.96, 1.96)*0.0802

[1] 0.495808 0.810192

> -0.229 + c(-1.96, 1.96)*0.0346

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

Saved successfully!

Ooh no, something went wrong!