Autocovariance sequence

Share:

Description

Calculates the autocovariance sequence for an input time series.

Usage

1
ACVS(x, biased=TRUE, center=TRUE)

Arguments

x

a numeric vector representing a uniformly sampled real-valued time series.

biased

a logical value. If TRUE, the biased estimator (normalized by N, the number of samples in the time series) is returned. If FALSE, the result is the unbiased estimator (the kth ACVS value is normalized by N - |k| for the unbiased case where k=0,...,N-1). Default: TRUE.

center

a logical value. If TRUE, the series is first centered (sample mean is subtracted from series) prior to calculating the ACVS. Default: TRUE.

Value

a numeric vector containing the single-sided ACVS for lags k=0,...,N-1 where N is the length of the input time series.

See Also

SDF.

Examples

1
2
3
4
## calculate the ACVS for an N(0,1) realization 
plot(seq(0,99), ACVS(rnorm(100)), type="l", lwd=2,
    xlab="lag",ylab="ACVS(rnorm(100))")
gridOverlay()

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.