Description Usage Arguments Note Author(s) See Also Examples
Creates an ACF chart or a two-panel plot with the ACF and PACF set to some specific defaults.
1 2 3 |
R |
an xts, vector, matrix, data frame, timeSeries or zoo object of asset returns |
maxlag |
the number of lags to calculate for, optional |
elementcolor |
the color to use for chart elements, defaults to "gray" |
main |
title of the plot; uses the column name by default. |
... |
any other passthru parameters |
Inspired by the website: http://www.stat.pitt.edu/stoffer/tsa2/Rcode/acf2.R "...here's an R function that will plot the ACF and PACF of a time series at the same time on the SAME SCALE, and it leaves out the zero lag in the ACF: acf2.R. If your time series is in x and you want the ACF and PACF of x to lag 50, the call to the function is acf2(x,50). The number of lags is optional, so acf2(x) will use a default number of lags [sqrt(n) + 10, where n is the number of observations]."
That description made a lot of sense, so it's implemented here for both the ACF alone and the ACF with the PACF.
Peter Carl
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.