Description Usage Arguments Details Value Source References See Also Examples

View source: R/plotArmaTrueacf.R

Compute the roots and theoretical ACF corresponding to an ARMA model

1 2 3 4 |

`object` |
either a numeric vector or a list with components 'ar' and 'ma'. If 'object' is numeric, it is interpreted as a model with no 'ma' part. |

`lag.max` |
the maximum number of lags for which to calculate the ACF or PACF |

`pacf` |
logical. Should the partial autocorrelations be returned? |

`plot` |
logical. Should the ACF (or PACF) be plotted? |

`xlab, ylab, ylim, type` |
arguments for 'plot' |

`complex.eps` |
a small positive number used to identify complex conjugates: Let 'roots' = the vector of p roots of the characteristic polynomial of the autoregressive part of 'object'. This is used by 'findConjugates': x[i] and x[j] are considered conjugate if their relative difference exceeds complex.eps but the relative difference of their conjugates is less than complex.eps. We use 'solve' in the 'polynom' package, because it was substially more accurate for cases we tested in R 2.6.0 than 'polyroot'. |

`...` |
optional arguments passed to 'plot' |

1. Compute and test stationarity. An ARMA process is stationary if all the roots of its AR component lie inside the unit circle (Box and Jenkins, 1970). If the process is not stationary, a warning is issued, and no plot is produced.

2. Compute and plot the theoretical ACF.

3. Analyze periodicity of any complex roots

a list with the following components

`roots` |
a complex vector of the roots sorted by modulus and sign of the immaginary part. |

`acf, pacf` |
a named numeric vector of the estimated ACF (or PACF of 'pacf = TRUE'). |

`periodicity` |
a data.frame with one row for each complex conjugate pair of roots and columns 'damping' and 'period'. |

http://faculty.chicagogsb.edu/ruey.tsay/teaching/fts2

George E. P. Box and Gwilym M. Jenkins (1970) Time Series Analysis, Forecasting and Control (Holden-Day, sec. 3.4.1. Stationarity and invertibility properties of Mixed autoregressive-moving average processes)

Ruey Tsay (2005) Analysis of Financial Time Series, 2nd ed. (Wiley, ch. 2)

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ```
# Tsay, Figure 2.3
op <- par(mfcol=c(1, 2))
plotArmaTrueacf(.8, lag.max=8)
title("(a)")
plotArmaTrueacf(-.8, lag.max=8)
title("b")
par(op)
# Tsay, Figure 2.4
op <- par(mfrow=c(2,2))
plotArmaTrueacf(c(1.2, -.35))
title("(a)")
plotArmaTrueacf(c(.6, -.4))
title("(b)")
plotArmaTrueacf(c(.2, .35))
title("(c)")
plotArmaTrueacf(c(-.2, .35))
title("(d)")
par(op)
# Tsay, Example 2.1
data(q.gnp4791)
(fit.ar3 <- ar(q.gnp4791, aic=FALSE, order=3))
plotArmaTrueacf(fit.ar3)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.