| tramoseats {RJDemetra} | R Documentation |
Seasonal Adjustment with TRAMO-SEATS
Description
Functions to estimate the seasonally adjusted series (sa) with the TRAMO-SEATS 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 (TRAMO) step.
tramoseats returns a preformatted result while jtramoseats returns the Java objects of the seasonal adjustment.
Usage
jtramoseats(
series,
spec = c("RSAfull", "RSA0", "RSA1", "RSA2", "RSA3", "RSA4", "RSA5"),
userdefined = NULL
)
tramoseats(
series,
spec = c("RSAfull", "RSA0", "RSA1", "RSA2", "RSA3", "RSA4", "RSA5"),
userdefined = NULL
)
Arguments
series |
an univariate time series |
spec |
a TRAMO-SEATS model specification. It can be the name ( |
userdefined |
a |
Details
The first step of a seasonal adjustment consists in pre-adjusting the time series with TRAMO. 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 SEATS 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, in the latter case pre-adjustment and decomposition are performed
on (log(y) = log(t) + log(s) + log(i)).
In the TRAMO-SEATS method, the second step - SEATS ("Signal Extraction in ARIMA Time Series") - performs an ARIMA-based decomposition of an observed time series into unobserved components. More information on this method at https://jdemetra-new-documentation.netlify.app/m-seats-decomposition.
The available predefined 'JDemetra+' TRAMO-SEATS 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) |
| RSA2 | | automatic | | AO/LS/TC | | 2 td vars + Easter | | Airline(+mean) |
| RSA3 | | automatic | | AO/LS/TC | | NA | | automatic |
| RSA4 | | automatic | | AO/LS/TC | | 2 td vars + Easter | | automatic |
| RSA5 | | automatic | | AO/LS/TC | | 7 td vars + Easter | | automatic |
| RSAfull | | automatic | | AO/LS/TC | | automatic | | automatic |
Value
jtramoseats returns a jSA object that contains the results of the seasonal adjustment without
any formatting. Therefore, the computation is faster than with the function tramoseats. The results of the seasonal
adjustment can be extracted with the function get_indicators.
tramoseats returns an object of class c("SA","TRAMO_SEATS"), that is, a list containing :
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 |
References
More information and examples related to 'JDemetra+' features in the online documentation: https://jdemetra-new-documentation.netlify.app/
BOX G.E.P. and JENKINS G.M. (1970), "Time Series Analysis: Forecasting and Control", Holden-Day, San Francisco.
BOX G.E.P., JENKINS G.M., REINSEL G.C. and LJUNG G.M. (2015), "Time Series Analysis: Forecasting and Control", John Wiley & Sons, Hoboken, N. J., 5th edition.
See Also
Examples
#Example 1
myseries <- ipi_c_eu[, "FR"]
myspec <- tramoseats_spec("RSAfull")
mysa <- tramoseats(myseries, myspec)
mysa
# Equivalent to:
mysa1 <- tramoseats(myseries, spec = "RSAfull")
mysa1
#Example 2
var1 <- ts(rnorm(length(myseries))*10, start = start(myseries), frequency = 12)
var2 <- ts(rnorm(length(myseries))*100, start = start(myseries), frequency = 12)
var <- ts.union(var1, var2)
myspec2 <- tramoseats_spec(myspec, tradingdays.mauto = "Unused",
tradingdays.option = "WorkingDays",
easter.type = "Standard",
automdl.enabled = FALSE, arima.mu = TRUE,
usrdef.varEnabled = TRUE, usrdef.var = var)
s_preVar(myspec2)
mysa2 <- tramoseats(myseries, myspec2,
userdefined = c("decomposition.sa_lin_f",
"decomposition.sa_lin_e"))
mysa2
plot(mysa2)
plot(mysa2$regarima)
plot(mysa2$decomposition)