PACF: Partial Auto-Covariance and Correlation Functions

Description Usage Arguments Details Value Author(s) Examples

View source: R/ACF.R

Description

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

Usage

1
PACF(x, lagmax = 0, cor = TRUE, demean = TRUE)

Arguments

x

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

lagmax

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

cor

A bool indicating whether the correlation (TRUE) or covariance (FALSE) should be computed. Defaults to TRUE.

demean

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

Details

lagmax default is 10*log10(N/m) where N is the number of observations and m is the number of time series being compared. If lagmax supplied is greater than the number of observations N, then one less than the total will be taken (i.e. N - 1).

Value

An array of dimensions N x 1 x 1.

Author(s)

Yunxiang Zhang

Examples

1
2
3
4
5
# Get Autocorrelation
m = PACF(datasets::AirPassengers)

# Get Autocovariance and do not remove trend from signal
m = PACF(datasets::AirPassengers, cor = FALSE, demean = FALSE)

SMAC-Group/simts documentation built on Sept. 5, 2018, 7:45 p.m.