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.

110

> plot(gspcrt)

Figure 10.8: First Order Differenced Daily Logarithmic Returns of S&500 Closing Prices.

It is clear from this chart that the volatility is not stationary in time. This is also reflected

in the plot of the correlogram, given in Figure 10.9. There are many peaks, including k = 1 and

k = 2, which are statistically significant beyond a white noise model.

In addition we see evidence of long-memory processes as there are some statistically significant

peaks at k = 16, k = 18 and k = 21:

> acf(gspcrt, na.action=na.omit)

Ultimately we will need a more sophisticated model than an autoregressive model of order p.

However, at this stage we can still try fitting such a model. Let us see what we get if we do so:

> gspcrt.ar <- ar(gspcrt, na.action=na.omit)

> gspcrt.ar$order

[1] 22

> gspcrt.ar$ar

[1] -0.111821507 -0.060150504 0.018791594 -0.025619932 -0.046391435

[6] 0.002266741 -0.030089046 0.030430265 -0.007623949 0.044260402

[11] -0.018924358 0.032752930 -0.001074949 -0.042891664 -0.039712505

[16] 0.052339497 0.016554471 -0.067496381 0.007070516 0.035721299

[21] -0.035419555 0.031325869

Using ar produces an AR(22) model, i.e. a model with 22 non-zero parameters! What does

this tell us? It is indicating that there is likely a lot more complexity in the serial correlation

than a simple linear model of past prices can really account for.

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

Saved successfully!

Ooh no, something went wrong!