gen_tc_outlier_matrix: Generate temporary change outlier regression matrix

View source: R/gen_tc_outlier_matrix.r

gen_tc_outlier_matrixR Documentation

Generate temporary change outlier regression matrix

Description

Generates a regression matrix of TC (temporary change) outliers to be included in weekly modeling routines

Usage

gen_tc_outlier_matrix(
  outlier_dates,
  this_week,
  this_year,
  forecast = 0,
  air_name = TRUE,
  this_freq = NULL,
  tc_alpha = NULL,
  return_xts = FALSE
)

Arguments

outlier_dates

Integer matrix - matrix of dates for TC outliers

this_week

Numeric vector; Week of the year for each observation.

this_year

Numeric vector; Year of each observation.

forecast

Numeric scalar; Number of forecasts. Default: 0.

air_name

Logical scalar; If TRUE, names are formatted as they are in the fractional airline routine; otherwise format them as in movereg. Default: TRUE

this_freq

Numeric scalar; frequency of time series. Default: 365.25/7, for a weekly series

tc_alpha

Numeric scalar; Rate of decay for the TC outlier. Default: will be computed as in X-13ARIMA-SEATS for a weekly series

return_xts

Logical scalar; return matrix as an xts time series object. Default is FALSE. If TRUE, this_week and this_year should be xts time series objects.

Value

Generate matrix of temporary change outlier regressors, with column names that describe the individual regressors

Examples

ic_tc_dates <-
   matrix(c(13, 2020), ncol=2, byrow=TRUE)
ic_tc_matrix <-
   gen_level_outlier_matrix(ic_tc_dates, ic_week, ic_year, 0,
                            return_xts = FALSE)
cc_tc_dates <-
   matrix(c(13, 2020), ncol=2, byrow=TRUE)
cc_tc_matrix_xts <-
   gen_level_outlier_matrix(cc_tc_dates, cc_week_xts, cc_year_xts, 0,
                            return_xts = TRUE)

bcmonsell/airutilities documentation built on May 16, 2022, 3:23 p.m.