Learn R Programming

tsaux (version 1.0.0)

additive_outlier: Anomaly Creation

Description

Creates specific types of anomalies given a series.

Usage

additive_outlier(y, time = 1, parameter = 0.5, add = TRUE)

temporary_change(y, time = 1, parameter = 0.5, alpha = 0.7, add = TRUE)

level_shift(y, time = 1, parameter = 0.5, add = TRUE)

Value

Either the contaminated series else a matrix of the anomaly.

Arguments

y

a univariate xts object or numeric series.

time

the time index at which the anomaly takes place.

parameter

the coefficient on the anomaly (the percent of the value of y at the specified time index representing the anomaly).

add

whether to contaminate the series (add the anomaly to the series) else will return a matrix with the anomaly (without the effect of the parameter).

alpha

the AR(1) coefficient for the temporary change which determines how quickly the effect decays.

Author

Alexios Galanos for this wrapper function.

Details

These functions allow the generation of anomalies and may be chained together.