Function allowing to customize the automatic outlier detection process built in in the pre-processing step (regarima or tramo).
Arguments
- x
the specification to customize, must be a "SPEC" class object (see details).
- span.type, d0, d1, n0, n1
parameters to specify the sub-span on which outliers will be detected.
d0andd1characters in the format "YYYY-MM-DD" to specify first/last date of the span whentypeequals to"From","To"or"Between".n0andn1numerics to specify the number of periods at the beginning/end of the series to be used for the span (typeequals to"From","To") or to exclude (typeequals to"Excluding").
- outliers.type
vector of characters of the outliers to be automatically detected.
"AO"for additive outliers,"TC"for transitory changes,"LS"for level shifts,"SO"for seasonal outliers. For exampleoutliers.type = c("AO", "LS")to enable the detection of additive outliers and level shifts. Ifoutliers.type = NULLoroutliers.type = character(), automatic detection of outliers is disabled. Default value =outliers.type = c("AO", "LS", "TC")
- critical.value
numeric. Critical value for the outlier detection procedure. If equal to 0 the critical value is automatically determined by the number of observations in the outlier detection time span. (Default value = 4 REGARIMA/X13 and 3.5 in TRAMO)- tc.rate
the rate of decay for the transitory change outlier. (Default = 0.7).
- method
(REGARIMA/X13 Specific) determines how the program successively adds detected outliers to the model. Currently, only the
"AddOne"method is supported.- maxiter
(REGARIMA/X13 Specific) maximum number of iterations (Default = 30).
- lsrun
(REGARIMA/X13 Specific) number of successive level shifts to test for cancellation (Default = 0).
- eml.est
(TRAMO Specific)
logicalfor the exact likelihood estimation method. It controls the method applied for parameter estimation in the intermediate steps. IfTRUE, an exact likelihood estimation method is used. WhenFALSE, the fast Hannan-Rissanen method is used.
Details
x specification parameter must be a JD3_X13_SPEC" class object
generated with rjd3x13::x13_spec() (or "JD3_REGARIMA_SPEC" generated
with rjd3x13::spec_regarima() or "JD3_TRAMOSEATS_SPEC" generated with
rjd3tramoseats::spec_tramoseats() or "JD3_TRAMO_SPEC" generated with
rjd3tramoseats::spec_tramo()).
If a Seasonal adjustment process is performed, each type of Outlier will be allocated to a pre-defined component after the decomposition: "AO" and "TC" to the irregular, "LS" to the trend and "SO" to seasonal component.
References
More information on outliers and other auxiliary variables in JDemetra+ online documentation: https://jdemetra-new-documentation.netlify.app/
Examples
# Customize a default specification
init_spec <- tramoseats_spec_default
new_spec <- set_outlier(
x = init_spec,
span.type = "From",
d0 = "2012-01-01",
outliers.type = c("LS", "AO"),
critical.value = 5,
tc.rate = 0.85
)