moving_ac_corrected: Transforms the data X to account for autocorrelation using a...

Description Usage Arguments Value

View source: R/moving_ac_corrected.R

Description

Transforms the data X by centring and scaling using X_{ij}^{'} = \frac{X_{ij}-μ_{ij}}{k_{i} σ_{ij}} where μ_{ij} and σ_{ij} are robust estimates for location and scale based on the median and the median absolute deviation of each variate (column) X_{i} of X calculated on a moving window centred at j. The scaling k_{i} = \surd{≤ft( \frac{1+φ_{i}}{1-φ_{i}} \right)} is a robust estimate for the autocorrelation at lag 1 calculated on an initial (burn-in) segment of the data where φ_{i} is calculated using a robust estimate for the autocorrelation of the burn-in segment.

Usage

1
moving_ac_corrected(X, burnin, window_size)

Arguments

X

A numeric matrix containing the potentially multivariate data to be transformed. Each column corresponds to a component and each row to an observation. The time series data classes ts, xts, and zoo are also supported.

burnin

A positive integer indicating the initial length of the data used to determine the value of φ_{i}.

window_size

A positive integer indication the length of the moving window.

Value

A numeric matrix of the same dimension as X containing the transformed data.


anomaly documentation built on Oct. 21, 2021, 1:06 a.m.