detect_ts_calendar_model_outliers_window: Detect outliers in time series based on a calendar model...

View source: R/preparation.R

detect_ts_calendar_model_outliers_windowR Documentation

Detect outliers in time series based on a calendar model (applied over a window of time)

Description

Detect elements of the time series out of a confidence threshold based on linear model of the calendar variables (month, weekday, hour). Detection done in an specific window of data

Usage

detect_ts_calendar_model_outliers_window(
  data,
  calendarFeatures = c("HOL", "H"),
  mode = "upperAndLower",
  upperModelPercentile = 90,
  lowerModelPercentile = 10,
  upperPercentualThreshold = 30,
  lowerPercentualThreshold = 30,
  holidaysCalendar = c(),
  daysThatAreOutliers = c(),
  outputPredictors = F,
  logValueColumn = F
)

Arguments

data

timeSeries An argument containing the time series from which the outliers need to be detected.

holidaysCalendar

list of dates An optional list giving the dates where local or national holidays related to the location of the data argument. Default is empty list.

daysThatAreOutliers

list of outlier dates

calendarFeatures:

list of strings An optional argument set the calendar features of the model. Default values are: ["HOL*intercept","H"]

mode:

string An optional argument setting which outliers need to be filtered, the ones upper, or the ones lower to the prediction. Default is "upperAndLower".

upperModelPercentile:

float An optional argument defining the percentile used in the quantile regression model for the upper prediction. Default is 90.

lowerModelPercentile:

float An optional argument defining the percentile used in the quantile regression model for the lower prediction. Default is 10.

upperPercentualThreshold:

float It sets the dynamic upper threshold to detect outliers. It is an optional argument to define the percentage of difference added to the upper model predition itself. Default is 30.

lowerPercentualThreshold:

float It sets the dynamic lower threshold to detect outliers. An optional argument to define the percentage of difference substracted to the predition of the model. Default is 30.

outputPredictors:

boolean. Include calendar regression model prediction results as output

logValueColumn:

boolean. Transform value column (log-transformation)

Value

<data.frame> with boolean values representing whether a item is an outlier, or not. Additionally, the predition results of the model are also presented.


biggproject/biggr documentation built on Oct. 2, 2024, 11:13 p.m.