clean_anomalies: Clean anomalies from anomalized data

Description Usage Arguments Details Value See Also Examples

View source: R/anomalize_clean.R

Description

Clean anomalies from anomalized data

Usage

1

Arguments

data

A tibble or tbl_time object.

Details

The clean_anomalies() function is used to replace outliers with the seasonal and trend component. This is often desirable when forecasting with noisy time series data to improve trend detection.

To clean anomalies, the input data must be detrended with time_decompose() and anomalized with anomalize(). The data can also be recomposed with time_recompose().

Value

Returns a tibble / tbl_time object with a new column "observed_cleaned".

See Also

Time Series Anomaly Detection Functions (anomaly detection workflow):

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
library(dplyr)

# Needed to pass CRAN check / This is loaded by default
set_time_scale_template(time_scale_template())

data(tidyverse_cran_downloads)

tidyverse_cran_downloads %>%
    time_decompose(count, method = "stl") %>%
    anomalize(remainder, method = "iqr") %>%
    clean_anomalies()

anomalize documentation built on Oct. 23, 2020, 5:54 p.m.