gen_air_projected_factors: Generate projected seasonal (and holiday) adjustment factors

View source: R/gen_air_projected_factors.r

gen_air_projected_factorsR Documentation

Generate projected seasonal (and holiday) adjustment factors

Description

Generates projected adjustment factors from the decomposition of the fractional airline model R routines

Usage

gen_air_projected_factors(
  this_est,
  this_decomp,
  this_xtype,
  this_x = NULL,
  this_log = TRUE,
  nfcasts = 104,
  return_series = "combined",
  return_xts = FALSE
)

Arguments

this_est

A list object generated by the estimation procedure of the fractional airline model; the regression matrix should not be extended with forecasts.

this_decomp

A list object generated by the decomposition procedure of the fractional airline model; the nfcasts option should have been specified.

this_xtype

Character vector; Type of regressor used for including regression effects into components ('hol' for holiday, 'ao' for point outliers, 'ls' for level change outliers).

this_x

Character vector; regression matrix.

this_log

Logical scalar; set to TRUE if the log transformation is used in the decomposition, FALSE otherwise. Default: TRUE

nfcasts

Integer scalar; number of projected adjustment factors; should match the nfcasts argument used to generate the decomposition.

return_series

Character scalar; component returned by the routine. Default is "combined"; other possible choices are "seasonal" and "holiday".

return_xts

Logical scalar; return projected factors of type return_series as an xts time series object. Default is FALSE. If TRUE, this_x must be an xts time series object.

Value

Array of projected adjustment factors from the fractional airline decomposition

Examples

ic_est <-
   rjd3highfreq::fractionalAirlineEstimation(ic_obs, periods=c(365.25/7),
                                             x=ic_default_matrix)
ic_decomp <-
   rjd3highfreq::fractionalAirlineDecomposition(ic_est$model$linearized, 365.25/7, 
                                                stde = TRUE, nfcasts = 104)
ic_xtype <- c(rep('hol', 13), rep('ao', 40))
ic_proj_seasonal <- 
   gen_air_projected_factors(ic_est, ic_decomp,
                      this_xtype = ic_xtype,
                      this_x     = ic_holiday_matrix_fcst,
                      this_log = FALSE, nfcasts = 104)

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