x13_spec and x13_pickmdl wrapped as a single function
x13_both.RdOutput 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
x13parameter- ...
Parameters to
x13_spec.- userdefined
Parameter to
x13(via...tox13_pickmdl).- both_output
One of
"main"(default, x13_pickmdl output),"spec"(spec output) or"both".- corona
Whether to update
specby outliers according tocorona_outliers.FALSEorNULLmeans no update.TRUEor"ssb"means update.- pickmdl_method
crit_selectionparameter or one of the two extra possibilities,"first_automdl"or"first_tryautomdl". In both cases thecrit_selectionparameter 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, thestarparameter changes."first_tryautomdl": When no pickmdl model is ok: The automdl model is chosen if this model is ok, otherwise thestarmodel is chosen.
- star
crit_selectionparameter- when_star
crit_selectionparameter- 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. Seecrit_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_specparameterestimate.tobefore runs used to identify (arima) parameters. This is an alternative toidentification_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.muis identified by the shortened series (seearima_mu).- automdl.enabled
Logical value or any other value.
When set to
FALSE(the default), the pickmdl routine is applied.When set to
TRUE, the automdl routine is performed.For any value other than
TRUEorFALSE, the ARIMA model is chosen as specified byspec.
Note that when
automdl.enabledis notFALSE, ifspecis a list containing several objects outputted fromx13_spec_pickmdl, only the first object is used.- fastfirst
When
TRUEand when pickmdl withcrit_selectionparameter"first", only as many models as needed are run. This affects the output whenoutput = "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 withok,ok_finalandmdl_nr) will be added to thex13output object. Usecommentto get the attribute orokto get the attribute converted to a list.- old_crit2
Logical. The p-value criterion used for PICKMDL criterion number 2. Set to
FALSEfor "Ljung-Box" and toTRUEfor "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 thatold_crit2 = (date_found < "2024-10-15"), wheredate_foundrefers to the end date according toidentification_endoridentification_estimate.to. If none of these is specified,old_crit2is set toFALSE. 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