Skip to contents

Output is determined by the parameter both_output.

Usage

x13_both(
  series,
  ...,
  userdefined = NULL,
  both_output = "main",
  corona = FALSE,
  pickmdl_method = "first",
  star = 1,
  when_star = warning,
  when_automdl = message,
  when_finalnotok = NULL,
  identification_end = NULL,
  identification_estimate.to = NULL,
  identify_t_filter = FALSE,
  identify_s_filter = FALSE,
  identify_outliers = TRUE,
  identify_arima_mu = TRUE,
  automdl.enabled = FALSE,
  fastfirst = TRUE,
  verbose = FALSE,
  output = "sa",
  add_comment = TRUE,
  old_crit2 = NA
)

Arguments

series

x13 parameter

...

Parameters to x13_spec.

userdefined

Parameter to x13 (via ... to x13_pickmdl).

both_output

One of "main" (default, x13_pickmdl output), "spec" (spec output) or "both".

corona

Whether to update spec by outliers according to corona_outliers. FALSE or NULL means no update. TRUE or "ssb" means update.

pickmdl_method

crit_selection parameter or one of the two extra possibilities, "first_automdl" or "first_tryautomdl". In both cases the crit_selection parameter is "first" and the automdl model is added as the last pickmdl model.

  • "first_automdl": The automdl model is chosen whenever no pickmdl model is ok. In other words, the star parameter changes.

  • "first_tryautomdl": When no pickmdl model is ok: The automdl model is chosen if this model is ok, otherwise the star model is chosen.

star

crit_selection parameter

when_star

crit_selection parameter

when_automdl

Function to be called when automdl since no pickmdl model ok. Supply NULL to do nothing.

when_finalnotok

Function to be called, e.g. warning, when final run with final model is not ok. Supply NULL to do nothing. See crit_ok.

identification_end

To shorten the series before runs used to identify (arima) parameters. That is, the series is shortened by window(series, end = identification_end).

identification_estimate.to

To set x13_spec parameter estimate.to before runs used to identify (arima) parameters. This is an alternative to identification_end.

identify_t_filter

When TRUE, Henderson trend filter is identified by the shortened (see above) series.

identify_s_filter

When TRUE, Seasonal moving average filter is identified by the shortened series.

identify_outliers

When TRUE, Outliers are identified by the shortened series.

identify_arima_mu

When TRUE, arima.mu is identified by the shortened series (see arima_mu).

automdl.enabled

When TRUE, automdl is performed instead of pickmdl. If spec is a list of several objects as outputted from x13_spec_pickmdl, only first object is used.

fastfirst

When TRUE and when pickmdl with crit_selection parameter "first", only as many models as needed are run. This affects the output when output = "all".

verbose

Printing information to console when TRUE.

output

One of "sa" (default), "spec" (final spec), "sa_spec" (both) and "all". See examples.

add_comment

When TRUE, a comment attribute (character vector with ok, ok_final and mdl_nr) will be added to the x13 output object. Use comment to get the attribute or ok to get the attribute converted to a list.

old_crit2

Logical. The p-value criterion used for PICKMDL criterion number 2. Set to FALSE for "Ljung-Box" and to TRUE for "Ljung-Box (residuals at seasonal lags)". This parameter can be overridden by setting the "pickmdl.old_crit2" option, in which case the option value will take precedence. The default value (NA) means that old_crit2 = (date_found < "2024-10-15"), where date_found refers to the end date according to identification_end or identification_estimate.to. If none of these is specified, old_crit2 is set to FALSE. The default value is chosen to ensure that the new criterion is phased in automatically.

Value

By default an x13 output object, or otherwise a list as specified by parameter output and both_output.

Details

All parameters except both_output and ... are parameters to x13_pickmdl.

Examples

a <- x13_both(pickmdl_data("myseries"), spec = "RSA3", transform.function = "Log", verbose = TRUE)
#> old_crit2 set to FALSE since no identification specification. 
#>  p  d  q bp bd bq 
#>  2  1  0  0  1  1 
#> outlier.from updated: 2021-10-01  New outliers: 2011-06 
a$decomposition
#> Monitoring and Quality Assessment Statistics:
#>       M stats
#> M(1)    0.577
#> M(2)    0.597
#> M(3)    3.000
#> M(4)    0.348
#> M(5)    3.000
#> M(6)    0.737
#> M(7)    0.223
#> M(8)    0.364
#> M(9)    0.166
#> M(10)   0.394
#> M(11)   0.368
#> Q       0.963
#> Q-M2    1.008
#> 
#> Final filters: 
#> Seasonal filter:  3x5
#> Trend filter:  23-Henderson