data_outliers: Clean outliers

Description Usage Arguments Value

View source: R/data_preparation.R

Description

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.

Usage

1
2
3
4
5
6
7
data_outliers(
  Data,
  variables = NULL,
  w.bounds = c(0.05, 0.95),
  trim = FALSE,
  cross_section = FALSE
)

Arguments

Data

data.frame: data frame of target variable, exogenous variables, and observed date (named 'date')

variables

string: vector of variables to standardize, default is all but 'date' column

w.bounds

double: vector of winsorizing minimum and maximum bounds, c(min percentile, max percentile)

trim

boolean: if TRUE then replace outliers with NA instead of winsorizing bound

cross_section

boolean: if TRUE then remove outliers based on cross-section (row-wise) instead of historical data (column-wise)

Value

data.frame with a date column and one column per forecast method selected


tylerJPike/OOS documentation built on March 20, 2021, 3:20 a.m.