smooth_outlier: Identify and replace outliers

View source: R/smooth_outlier.R

smooth_outlierR Documentation

Identify and replace outliers

Description

The function smooth_outlier() is a wrapper for forecast::tsoutliers(), working with numeric vectors. For non-seasonal time series, the supsmu method is used. For seasonal time series, the series is decomposed via STL and the IQR method is used on the remainder component. Values outside the range are linear interpolated on the remainder and the series is reconstructed with the corrected remainder component.

Usage

smooth_outlier(x, periods, ...)

Arguments

x

Numeric vector.

periods

Numeric vector. The seasonal periods of the time series.

...

Further arguments passed to forecast::msts() or forecast::tsoutliers().

Value

Numeric vector.


ahaeusser/tscv documentation built on July 26, 2023, 3:18 p.m.