acf.ext1: Autocorrelation function for several transformations of the...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/partsm.R

Description

This function is based on the acf function and extends it by allowing for some transformations of the data before computing the autocovariance or autocorrelation function.

Usage

1
2
      acf.ext1 (wts, transf.type, perdiff.coeffs, type, lag.max, showcat, plot)
   

Arguments

wts

a univariate time series object.

transf.type

a character string indicating what transformation should be applied to the data. Allowed values are "orig", "fdiff", "sdiff", "fsdiff", "fdiffsd", "perdiff", and ""perdiffsd. See details.

perdiff.coeffs

a vector with the estimates coefficients for the periodic difference filter. This argument is only required when the periodic difference transformation must be applied to the data. See details.

type

a character string giving the type of acf to be computed. Allowed values are "correlation", "covariance" or "partial".

lag.max

maximum number of lags at which to calculate the acf.

showcat

a logical. If TRUE, the results are printed in detail. If FALSE, the results are stored as a list object.

plot

a logical. If TRUE, a plot of the acf is showed.

Details

The implemented transformations are the following:

Value

Lags at which the acf is computed, estimates of the acf, and p-values for the significance of the acf at each lag.

Author(s)

Javier Lopez-de-Lacalle javlacalle@yahoo.es.

See Also

acf.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
      ## Logarithms of the Real GNP in Germany
      data("gergnp")
      lgergnp <- log(gergnp, base=exp(1))

      out <- acf.ext1(wts=lgergnp, transf.type="orig",
                      type="correlation", lag.max=12, showcat=TRUE, plot=FALSE)

      out <- acf.ext1(wts=lgergnp, transf.type="perdiffsd", 
                      perdiff.coeff = c(1.004, 0.981, 1.047, 0.969),
                      type="correlation", lag.max=12, showcat=TRUE, plot=FALSE)
   

partsm documentation built on Nov. 25, 2020, 5:07 p.m.