A function to clean outliers. Is used as a data preparation helper function and is called internally by forecast_univariate, forecast_multivariate, and forecast_combine.
data_outliers(
Data,
variables = NULL,
w.bounds = c(0.05, 0.95),
trim = FALSE,
cross_section = FALSE
)data.frame: data frame of target variable, exogenous variables, and observed date (named 'date')
string: vector of variables to standardize, default is all but 'date' column
double: vector of winsorizing minimum and maximum bounds, c(min percentile, max percentile)
boolean: if TRUE then replace outliers with NA instead of winsorizing bound
boolean: if TRUE then remove outliers based on cross-section (row-wise) instead of historical data (column-wise)
data.frame with a date column and one column per forecast method selected