Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

acf2

Plot and print ACF and PACF of a time series


Description

Produces a simultaneous plot (and a printout) of the sample ACF and PACF on the same scale. The zero lag value of the ACF is removed.

Usage

acf2(series, max.lag=NULL, plot=TRUE, main=NULL, ylim=NULL,
     na.action = na.pass, ...)

Arguments

series

The data. Does not have to be a time series object.

max.lag

Maximum lag. Can be omitted. Defaults to √{n} + 10 unless n < 60. If the series is seasonal, this will be at least 4 seasons by default.

plot

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.

main

Title of graphic; defaults to name of series.

ylim

Specify limits for the y-axis.

na.action

How to handle missing data; default is na.pass

...

Additional arguments passed to acf

Details

This is basically a wrapper for acf() provided in tseries. The error bounds are approximate white noise bounds, 0 \pm 2/√{n}; no other option is given.

Value

ACF

The sample ACF

PACF

The sample PACF

Author(s)

D.S. Stoffer

References

Examples

acf2(rnorm(100))
acf2(rnorm(100), 25, main='')  # no title
acf2(rnorm(100), plot=FALSE)[,'ACF']  # print only ACF

astsa

Applied Statistical Time Series Analysis

v1.12
GPL-3
Authors
David Stoffer
Initial release
2020-12-20

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.