Learn R Programming

forecast (version 8.1)

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

Description

Uses supsmu for non-seasonal series and a periodic stl decompostion with seasonal series to identify outliers. To estimate missing values and outlier replacements, linear interpolation is used on the (possibly seasonally adjusted) series

Usage

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

Arguments

x

time series

replace.missing

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

lambda

a numeric value giving the Box-Cox transformation parameter

Value

Time series

See Also

na.interp, tsoutliers, supsmu

Examples

Run this code
# NOT RUN {
cleangold <- tsclean(gold)

# }

Run the code above in your browser using DataLab