detect_ts_calendar_model_outliers: Detect outliers in time series based on a calendar model

View source: R/preparation.R

detect_ts_calendar_model_outliersR Documentation

Detect outliers in time series based on a calendar model

Description

Detect elements of the time series out of a confidence threshold based on linear model of the calendar variables (month, weekday, hour).

Usage

detect_ts_calendar_model_outliers(
  data,
  localTimeColumn = "localtime",
  valueColumn = outputName,
  calendarFeatures = c("HOL", "H"),
  mode = "upperAndLower",
  upperModelPercentile = 90,
  lowerModelPercentile = 10,
  upperPercentualThreshold = 30,
  lowerPercentualThreshold = 30,
  holidaysCalendar = c(),
  daysThatAreOutliers = c(),
  window = NULL,
  outputPredictors = F,
  logValueColumn = F,
  autoDetectProfiled = T
)

Arguments

data

<data.frame> 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

window

string. A string in ISO 8601 format representing the window (e.g. "P2M","P4M","P14D",...). This is an optional argument setting the width of the window where the model is trained and evaluated

localTimeColumn:

string Local time column name

valueColumn:

string Value column name

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.

outputPredictor:

boolean. Include calendar regression model prediction results as output

logValueColumn:

boolean. Transform value column (log-transformation)

autoDetectProfiled:

boolean. Detect and ignore profiled days from timeseries

Value

timeSeries with time index outliers mask and optional calendar regression model prediction


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