PerACF {acfMPeriod}R Documentation

Autocorrelation or autocovariance function estimation from the periodogram

Description

This function computer and plots(by default) the estimates of the autocovariance or the autocorrelation function for univariate and multivariate time series based on the periodogram and the cross-periodogram..

Usage

PerACF(x, lag.max = NULL, type = c("correlation", "covariance"),
  plot = TRUE, na.action = na.fail, demean = TRUE, ...)

Arguments

x

a numeric vector or matrix.

lag.max

maximum lag at which to calculate the acf. Default is 10*log10(N/m) where N is the number of observations and m the number of series. Will be automatically limited to one less than the number of observations in the series.

type

character string giving the type of acf to be computed. Allowed values are "correlation" (the default) or "covariance". Accepts parcial names.

plot

logical. If TRUE (the default) the acf is plotted.

na.action

function to be called to handle missing values. na.pass can be used.

demean

logical. Should the covariances be about the sample means?

...

further arguments to be passed to plot.acf.

Value

An object of class "acf", which is a list with the following elements:

lag A three dimensional array containing the lags at which the acf is estimated.

acf An array with the same dimensions as lag containing the estimated acf.

type The type of correlation (same as the type argument).

n.used The number of observations in the time series.

series The name of the series x.

snames The series names for a multivariate time series.

The result is returned invisibly if plot is TRUE.

Author(s)

Higor Cotta, Valderio Reisen, Pascal Bondon and Céline Lévy-Leduc. Part of the code re-used from the acf() function.

References

Fuller, Wayne A. Introduction to statistical time series. John Wiley & Sons, 2009.

Examples

data.set <- cbind(fdeaths, mdeaths)
PerACF(data.set)
PerACF(data.set, type = "covariance", lag.max = 10)

[Package acfMPeriod version 1.0.0 Index]