Creates specific types of anomalies given a series.
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)
Either the contaminated series else a matrix of the anomaly.
a univariate xts object or numeric series.
the time index at which the anomaly takes place.
the coefficient on the anomaly (the percent of the value of y at the specified time index representing the anomaly).
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).
the AR(1) coefficient for the temporary change which determines how quickly the effect decays.
Alexios Galanos for this wrapper function.
These functions allow the generation of anomalies and may be chained together.