Produces a plot (and a printout) of the sample ACF or PACF. The zero lag value of the ACF is removed.
acf1(series, max.lag = NULL, plot = TRUE, main = NULL, ylim = NULL, pacf = FALSE,
ylab = NULL, xlab = NULL, na.action = na.pass, ...)
The sample ACF or PACF
The data. Does not have to be a time series object.
Maximum lag. Can be omitted. Defaults to \(\sqrt{n} + 10\) unless \(n < 60\). If the series is seasonal, this will be at least 4 seasons by default.
If TRUE (default), a graph is produced and the values are rounded and listed. If FALSE, no graph is produced and the values are listed but not rounded by the script.
Title of graphic; defaults to name of series.
Specify limits for the y-axis.
If TRUE, the sample PACF is returned instead of ACF.
Change y-axis label from default.
Change x-axis label from default.
How to handle missing data; default is na.pass
Additional arguments passed to tsplot
D.S. Stoffer
Will print and/or plot the sample ACF or PACF (if pacf=TRUE
). The zero lag of the ACF (which is always 1) has been removed. If plot=TRUE
, a graph is produced and the values are rounded and listed. If FALSE, no graph is produced and the values are listed but not rounded by the script. The error bounds are approximate white noise bounds, \(-1/n \pm 2/\sqrt{n}\); no other option is given.
You can find demonstrations of astsa capabilities at FUN WITH ASTSA.
The most recent version of the package can be found at https://github.com/nickpoison/astsa/.
In addition, the News and ChangeLog files are at https://github.com/nickpoison/astsa/blob/master/NEWS.md.
The webpages for the texts and some help on using R for time series analysis can be found at https://nickpoison.github.io/.
acf2
, acfm
, ccf2
acf1(rnorm(100))
acf1(sarima.sim(ar=.9), pacf=TRUE)
# show it to your mom:
acf1(soi, col=2:7, lwd=4, gg=TRUE)
Run the code above in your browser using DataLab