AutoCorr: AutoCorrelation

View source: R/AutoCorr.R

AutoCorrR Documentation

AutoCorrelation

Description

Calculates the AutoCorrelation function

Usage

AutoCorr(TimeSeries, nLags = 2, PlotIt = FALSE,...)

Arguments

TimeSeries

A numeric time series object, or a numeric vector/matrix.

nLags

Number of lags. Default is 2.

PlotIt

Boolean, TRUE if auto correlation plot should be printed, FALSE else. Default is FALSE.

...

further arguments passed on to output of ccf

Details

Calculation is based on the sample covariance. For further details see acf.

Value

List with

acf

A three dimensional array containing the estimated acf.

type

"Correlation".

n.used

The number of observations in the time series.

lag

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

series

Name of time series

snames

The series names for a multivariate time series. NULL for univariate time series.

Author(s)

Michael Thrun

Examples

data("ElectricityBRD")
res = AutoCorr(ElectricityBRD$Mrd_KWh, nLags = 5, PlotIt = TRUE, main="Electricity production in BRD in Mrd KWh")

Mthrun/TSAT documentation built on Feb. 5, 2024, 11:15 p.m.