x13_spec
and x13_pickmdl
wrapped as a single function
x13_both.Rd
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...
tox13_pickmdl
).- both_output
One of
"main"
(default, x13_pickmdl output),"spec"
(spec output) or"both"
.- corona
Whether to update
spec
by outliers according tocorona_outliers
.FALSE
orNULL
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 thecrit_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, thestar
parameter changes."first_tryautomdl"
: When no pickmdl model is ok: The automdl model is chosen if this model is ok, otherwise thestar
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. 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_spec
parameterestimate.to
before 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.mu
is identified by the shortened series (seearima_mu
).- automdl.enabled
When
TRUE
, automdl is performed instead of pickmdl. Ifspec
is a list of several objects as outputted fromx13_spec_pickmdl
, only first object is used.- fastfirst
When
TRUE
and when pickmdl withcrit_selection
parameter"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_final
andmdl_nr
) will be added to thex13
output object. Usecomment
to get the attribute orok
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 toTRUE
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 thatold_crit2 = (date_found < "2024-10-15")
, wheredate_found
refers to the end date according toidentification_end
oridentification_estimate.to
. If none of these is specified,old_crit2
is 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