View source: R/gen_outlier_matrix.r
gen_outlier_matrix | R Documentation |
Generates a regression matrix of AO (point) outliers to be included in weekly modeling routines
gen_outlier_matrix( outlier_dates, this_week, this_year, forecast = 0, air_name = TRUE, return_xts = FALSE )
outlier_dates |
Integer matrix - matrix of dates for point 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 |
return_xts |
Logical scalar; return matrix as an |
Generate matrix of point outlier regressors, with column names that describe the individual regressors
ic_outlier_date <- matrix(c(30, 1992, 30, 1993, 52, 1993, 5, 1994, 3, 1996, 38, 2001, 39, 2001, 40, 2001, 41, 2001, 42, 2001, 43, 2001, 47, 2001, 48, 2001, 37, 2005, 38, 2005, 39, 2005, 40, 2005, 41, 2005, 1, 2006, 2, 2007, 4, 2008, 45, 2012, 35, 2017, 12, 2020, 13, 2020, 14, 2020, 15, 2020, 16, 2020), ncol=2, byrow=TRUE) ic_outlier_matrix_1992 <- gen_outlier_matrix(ic_outlier_date, ic_week, ic_year, 0, return_xts = FALSE) cc_outlier_dates_1992 <- matrix(c(30, 1992, 30, 1993, 52, 1993, 5, 1994, 3, 1996, 38, 2001, 39, 2001, 40, 2001, 41, 2001, 42, 2001, 43, 2001, 47, 2001, 48, 2001, 37, 2005, 38, 2005, 39, 2005, 40, 2005, 41, 2005, 1, 2006, 2, 2007, 4, 2008, 45, 2012, 35, 2017, 12, 2020, 13, 2020), ncol=2, byrow=TRUE) cc_level_matrix_xts_1992 <- gen_level_outlier_matrix(cc_outlier_dates_1992, cc_week_xts, cc_year_xts, 0, return_xts = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.