Skip to contents

Set X-11 Specification

Usage

set_x11(
  x,
  mode = c(NA, "Undefined", "Additive", "Multiplicative", "LogAdditive",
    "PseudoAdditive"),
  seasonal.comp = NA,
  seasonal.filter = NA,
  henderson.filter = NA,
  lsigma = NA,
  usigma = NA,
  fcasts = NA,
  bcasts = NA,
  calendar.sigma = c(NA, "None", "Signif", "All", "Select"),
  sigma.vector = NA,
  exclude.forecast = NA,
  bias = c(NA, "LEGACY", "SMOOTH", "RATIO")
)

Arguments

x

the specification to be modified, object of class "JD3_X11_SPEC", default X11 spec can be obtained as 'x=x11_spec()'

mode

character: the decomposition mode in X11. Determines the mode of the seasonal adjustment decomposition to be performed: If a pre-adjustment is performed mode is inherited:

  • if log transformation in pre-adjustment, X11 mode is "Multiplicative" by default (or can also be "LogAdditive" if set by the user)

  • if no log transformation, X11 mode is "Additive" by default (or can also be "PseudoAdditive" if set by the user)

  • If NO pre-adjustment is performed, just X-11 decomposition using x = x11_spec() spec, mode is "Multiplicative" by default, it can be set to "Additive", "LogAdditive", "PseudoAdditive" (could be changed by the program, if needed). If set to "Undefined" an additive decomposition is performed, see details.

seasonal.comp

logical: if TRUE, the program computes a seasonal component. Otherwise, the seasonal component is not estimated and its values are all set to 0 (additive decomposition) or 1 (multiplicative decomposition).

seasonal.filter

a vector of character(s) specifying which seasonal moving average (i.e. seasonal filter) will be used to estimate the seasonal factors for the entire series. The vector can be of length: 1 - the same seasonal filter is used for all periods (e.g.: seasonal.filter = "Msr" or seasonal.filter = "S3X3" ); or have a different value for each quarter (length 4) or each month (length 12) - (e.g. for quarterly series: seasonal.filter = c("S3X3", "Msr", "S3X3", "Msr")). Possible filters are: "Msr", "Stable", "X11Default", "S3X1", "S3X3", "S3X5", "S3X9", "S3X15". "Msr" - the program chooses the final seasonal filter automatically.

henderson.filter

numeric: the length of the Henderson filter (odd number between 3 and 101). If henderson.filter = 0 an automatic selection of the Henderson filter's length for the trend estimation is enabled.

lsigma

numeric: the lower sigma boundary for the detection of extreme values, > 0.5, default=1.5.

usigma

numeric: the upper sigma boundary for the detection of extreme values, > lsigma, default=2.5.

bcasts, fcasts

numeric: the number of backcasts (bcasts) or forecasts (fcasts) generated by the RegARIMA model in periods (positive values) or years (negative values).Default values: fcasts=-1 and bcasts=0.

calendar.sigma

character to specify if the standard errors used for extreme values detection and adjustment are computed: from 5 year spans of irregulars ("None", default value); separately for each calendar period ("All"); separately for each period only if Cochran's hypothesis test determines that the irregular component is heteroskedastic by calendar month/quarter ("Signif"); separately for two complementary sets of calendar months/quarters specified by the x11.sigmaVector parameter ("Select", see parameter sigma.vector).If sigma.vector is specified then calendar.sigma is set to "Select"`.

sigma.vector

a vector to specify one of the two groups of periods for which standard errors used for extreme values detection and adjustment will be computed separately. Possible values are: 1 or 2.

exclude.forecast

Boolean to exclude forecasts and backcasts. If TRUE, the RegARIMA model forecasts and backcasts are not used during the detection of extreme values in the seasonal adjustment routines. Default = FALSE.

bias

If mode = "LogAdditive" (only in this case) a correction is applied when computing final components (S, T, I) in level from components estimated in log. Then bias= "RATIO" (default) Average of S (on complete years) and I (on the whole series) is set to 1, the correction is allocated to T.). "LEGACY" or "SMOOTH" corrections are based on trend filters.

Value

a "JD3_X11_SPEC" object, containing all the parameters.

Details

Decomposition mode formulas (Y: raw series, T: trend, S: seasonal, I: Irregular, SA: seasonally adjusted series)

  • Additive: Y=T+S+I, SA =Y-S=T+I

  • Multiplicative Y=T*S*I, SA =Y/S=T*I

  • LogAdditive Log(Y) = T + S + I, SA=exp(T+I)=Y/exp(S)

  • PseudoAdditive Y=T*(S+I-1), SA=T*I

See also

Examples

init_spec <- x13_spec()
new_spec <- set_x11(init_spec,
    mode = "LogAdditive",
    seasonal.comp = 1,
    seasonal.filter = "S3X9",
    henderson.filter = 7,
    lsigma = 1.7,
    usigma = 2.7,
    fcasts = -1,
    bcasts = -1,
    calendar.sigma = "All",
    sigma.vector = NA,
    exclude.forecast = FALSE,
    bias = "RATIO"
)