Learn R Programming

waveslim (version 1.12)

my.acf: Auotocovariance Function via the Discrete Fourier Transform

Description

Computes the autocovariance function for a time series.

Usage

my.acf(x)

Arguments

x
time series

Value

  • The autocovariance function, for all nonnegative lags, is output.

Details

The series is zero padded to twice its length before the discrete Fourier transform is applied. Only the values corresponding to nonnegative lags are provided.

Examples

Run this code
data(ibm)
ibm.returns <- diff(log(ibm))
plot(1:length(ibm.returns) - 1, my.acf(ibm.returns), type="h",
     xlab="lag", ylab="ACVS", main="Autocovariance Sequence for IBM Returns")

Run the code above in your browser using DataLab