x13 | R Documentation |
Functions to estimate the seasonally adjusted series (sa) with the X13-ARIMA method.
This is achieved by decomposing the time series (y) into the trend-cycle (t), the seasonal component (s) and the irregular component (i).
Calendar-related movements can be corrected in the pre-treatment (regarima) step.
x13
returns a preformatted result while jx13
returns the Java objects resulting from the seasonal adjustment.
jx13(
series,
spec = c("RSA5c", "RSA0", "RSA1", "RSA2c", "RSA3", "RSA4c", "X11"),
userdefined = NULL
)
x13(
series,
spec = c("RSA5c", "RSA0", "RSA1", "RSA2c", "RSA3", "RSA4c", "X11"),
userdefined = NULL
)
series |
an univariate time series |
spec |
the x13 model specification. It can be the name ( |
userdefined |
a |
The first step of a seasonal adjustment consists in pre-adjusting the time series. This is done by removing
its deterministic effects (calendar and outliers), using a regression model with ARIMA noise (RegARIMA, see: regarima
).
In the second part, the pre-adjusted series is decomposed by the X11 algorithm into the following components:
trend-cycle (t), seasonal component (s) and irregular component (i). The decomposition can be:
additive (y = t + s + i
) or multiplicative (y = t * s * i
).
More information on the X11 algorithm at https://jdemetra-new-documentation.netlify.app/m-x11-decomposition.
The available pre-defined 'JDemetra+' X13 model specifications are described in the table below:
Identifier | | Log/level detection | | Outliers detection | | Calendar effects | | ARIMA |
RSA0 | | NA | | NA | | NA | | Airline(+mean) |
RSA1 | | automatic | | AO/LS/TC | | NA | | Airline(+mean) |
RSA2c | | automatic | | AO/LS/TC | | 2 td vars + Easter | | Airline(+mean) |
RSA3 | | automatic | | AO/LS/TC | | NA | | automatic |
RSA4c | | automatic | | AO/LS/TC | | 2 td vars + Easter | | automatic |
RSA5c | | automatic | | AO/LS/TC | | 7 td vars + Easter | | automatic |
X11 | | NA | | NA | | NA | | NA |
jx13
returns the result of the seasonal adjustment in a Java (jSA
) object, without any formatting.
Therefore, the computation is faster than with the x13
function. The results of the seasonal adjustment can be
extracted with the function get_indicators
.
x13
returns an object of class c("SA","X13")
, that is, a list containing the following components:
regarima |
an object of class |
decomposition |
an object of class
|
final |
an object of class |
diagnostics |
an object of class
|
user_defined |
an object of class |
More information and examples related to 'JDemetra+' features in the online documentation: https://jdemetra-new-documentation.netlify.app/
x13_spec
, tramoseats
myseries <- ipi_c_eu[, "FR"]
mysa <- x13(myseries, spec = "RSA5c")
myspec1 <- x13_spec(mysa, tradingdays.option = "WorkingDays",
usrdef.outliersEnabled = TRUE,
usrdef.outliersType = c("LS","AO"),
usrdef.outliersDate = c("2008-10-01", "2002-01-01"),
usrdef.outliersCoef = c(36, 14),
transform.function = "None")
mysa1 <- x13(myseries, myspec1)
mysa1
summary(mysa1$regarima)
myspec2 <- x13_spec(mysa, automdl.enabled =FALSE,
arima.coefEnabled = TRUE,
arima.p = 1, arima.q = 1, arima.bp = 0, arima.bq = 1,
arima.coef = c(-0.8, -0.6, 0),
arima.coefType = c(rep("Fixed", 2), "Undefined"))
s_arimaCoef(myspec2)
mysa2 <- x13(myseries, myspec2,
userdefined = c("decomposition.d18", "decomposition.d19"))
mysa2
plot(mysa2)
plot(mysa2$regarima)
plot(mysa2$decomposition)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.