gen_hybrid_sa_xts: Generate a hybrid seasonal adjustment of an xts time series...

View source: R/gen_hybrid_sa_xts.r

gen_hybrid_sa_xtsR Documentation

Generate a hybrid seasonal adjustment of an xts time series object

Description

Generates a "hybrid" seasonal adjustment by replacing a span of a multiplicative seasonal adjustment with an additive adjustment

Usage

gen_hybrid_sa_xts(
  this_mult_sa,
  this_add_sa,
  this_start_hybrid,
  this_end_hybrid,
  this_week_xts,
  this_year_xts
)

Arguments

this_mult_sa

xts time series object of a multiplicative seasonal adjustment

this_add_sa

xts time series object of an additive seasonal adjustment

this_start_hybrid

integer vector of length 2, start of the span where additive adjustments replace multiplicative adjustment, defined as c(year, week)

this_end_hybrid

integer vector of length 2, end of the span where additive adjustments replace multiplicative adjustment, defined as c(year, week)

this_week_xts

Numeric vector; Week of the year for each observation, stored as an xts time series object.

this_year_xts

Numeric vector; Year of each observation, stored as an xts time series object.

Value

xts series object with hybrid seasonal adjustment

Examples

cc_hybrid_sa <- gen_hybrid_sa_xts(cc_sa_tc_log, cc_sa_tc_nolog, c(2020,12), c(2020, 52),
                                  cc_week_xts, cc_year_xts)

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