The PACF function estimates the partial autocovariance or autocorrelation for both univariate time series.

PACF(x, lag.max = NULL, type = "correlation", demean = TRUE)

Arguments

x

A vector or ts object (of length \(N > 1\)).

lag.max

An integer indicating the maximum lag up to which to compute the empirical PACF.

type

A character string giving the type of acf to be computed. Allowed values are "correlation" (the default) and "covariance".

demean

A bool indicating whether the data should be detrended (TRUE) or not (FALSE). Defaults to TRUE.

Value

An array of dimensions \(N \times 1 \times 1\).

Examples

# Get Autocorrelation m = PACF(datasets::AirPassengers) # Get Autocovariance and do not remove trend from signal m = PACF(datasets::AirPassengers, cor = FALSE, demean = FALSE)
#> Error in PACF(datasets::AirPassengers, cor = FALSE, demean = FALSE): unused argument (cor = FALSE)