Perform the X-11 decomposition using custom trend filter

x11plus_trend(
  x,
  period = frequency(x),
  trend.coefs,
  mul = TRUE,
  seas.s0 = c("S3X3", "S3X1", "S3X5", "S3X9", "S3X15"),
  seas.s1 = c("S3X5", "S3X3", "S3X1", "S3X9", "S3X15"),
  extreme.lsig = 1.5,
  extreme.usig = 2.5,
  userdefined = NULL
)

Arguments

x

input time-series.

period

period.

trend.coefs

coefficients of the filters used for the trend-cycle extraction from the real-time asymmetric filter to the symmetric filter. Can be a, object of class "list", "matrix", "lp_filter" or "rkhs_filter".

mul

boolean indicating if the decomposition mode is multiplicative.

seas.s0, seas.s1

seasonal filters.

extreme.lsig, extreme.usig

boundaries used for outlier correction in irregular.

userdefined

a vector containing the additional output variables.

Examples

q<-x11plus(rjd3toolkit::retail$AllOtherGenMerchandiseStores, 12)
x <- q$decomposition$sa
decomposition_lp <- x11plus_trend(x, trend.coefs = rjd3filters::lp_filter())
decomposition_rkhs <- x11plus_trend(x, trend.coefs = rjd3filters::rkhs_filter())
plot(x)
lines(decomposition_lp$decomposition[,"t"], col = "red")
lines(decomposition_rkhs$decomposition[,"t"], col = "green")