tsclean: Identify and replace outliers and missing values in a time...

View source: R/clean.R

tscleanR Documentation

Identify and replace outliers and missing values in a time series

Description

Uses supsmu for non-seasonal series and a robust STL decomposition for seasonal series. To estimate missing values and outlier replacements, linear interpolation is used on the (possibly seasonally adjusted) series

Usage

tsclean(x, replace.missing = TRUE, iterate = 2, lambda = NULL)

Arguments

x

time series

replace.missing

If TRUE, it not only replaces outliers, but also interpolates missing values

iterate

the number of iterations required

lambda

Box-Cox transformation parameter. If lambda="auto", then a transformation is automatically selected using BoxCox.lambda. The transformation is ignored if NULL. Otherwise, data transformed before model is estimated.

Value

Time series

Author(s)

Rob J Hyndman

References

Hyndman (2021) "Detecting time series outliers" https://robjhyndman.com/hyndsight/tsoutliers/.

See Also

na.interp, tsoutliers, supsmu

Examples


cleangold <- tsclean(gold)


forecast documentation built on June 22, 2024, 9:20 a.m.