Clean anomalies from anomalized data
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
The data can also be recomposed with
tbl_time object with a new column "observed_cleaned".
Time Series Anomaly Detection Functions (anomaly detection workflow):
## Not run: 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() ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.