Title: | Seasonal Adjustment with TRAMO-SEATS in 'JDemetra+ 3.x' |
---|---|
Description: | R Interface to 'JDemetra+ 3.x' (<https://github.com/jdemetra>) time series analysis software. It offers full acces to options and outputs of TRAMO-SEATS (Time series Regression with ARIMA noise, Missing values and Outliers - Signal Extraction in ARIMA Time Series), including TRAMO modelling (automatic ARIMA model with outlier detection and trading days adjustment). |
Authors: | Jean Palate [aut], Alain Quartier-la-Tente [aut] , Tanguy Barthelemy [aut, cre, art], Anna Smyk [aut] |
Maintainer: | Tanguy Barthelemy <[email protected]> |
License: | file LICENSE |
Version: | 3.3.0 |
Built: | 2024-11-27 04:09:13 UTC |
Source: | https://github.com/rjdverse/rjd3tramoseats |
Deprecated functions
fast_tramoseats( ts, spec = c("rsafull", "rsa0", "rsa1", "rsa2", "rsa3", "rsa4", "rsa5"), context = NULL, userdefined = NULL ) fast_tramo( ts, spec = c("trfull", "tr0", "tr1", "tr2", "tr3", "tr4", "tr5"), context = NULL, userdefined = NULL ) spec_tramoseats( name = c("rsafull", "rsa0", "rsa1", "rsa2", "rsa3", "rsa4", "rsa5") ) spec_tramo(name = c("trfull", "tr0", "tr1", "tr2", "tr3", "tr4", "tr5"))
fast_tramoseats( ts, spec = c("rsafull", "rsa0", "rsa1", "rsa2", "rsa3", "rsa4", "rsa5"), context = NULL, userdefined = NULL ) fast_tramo( ts, spec = c("trfull", "tr0", "tr1", "tr2", "tr3", "tr4", "tr5"), context = NULL, userdefined = NULL ) spec_tramoseats( name = c("rsafull", "rsa0", "rsa1", "rsa2", "rsa3", "rsa4", "rsa5") ) spec_tramo(name = c("trfull", "tr0", "tr1", "tr2", "tr3", "tr4", "tr5"))
ts , spec , context , userdefined , name
|
Parameters. |
These functions are used in all JDemetra+ 3.0 packages to easily interact between R and Java objects.
.tramoseats_rslts(jrslts) .jd2r_spec_tramo(jspec) .r2jd_spec_tramo(spec) .jd2r_spec_tramoseats(jspec) .r2jd_spec_tramoseats(spec)
.tramoseats_rslts(jrslts) .jd2r_spec_tramo(jspec) .r2jd_spec_tramo(spec) .jd2r_spec_tramoseats(jspec) .r2jd_spec_tramoseats(spec)
spec , jspec , jrslts
|
parameters. |
Function allowing to create a new specification by updating a specification used for a previous estimation. Some selected parameters will be kept fixed (previous estimation results) while others will be freed for re-estimation in a domain of constraints. See details and examples.
tramo_refresh( spec, refspec = NULL, policy = c("FreeParameters", "Complete", "Outliers_StochasticComponent", "Outliers", "FixedParameters", "FixedAutoRegressiveParameters", "Fixed", "Current"), period = 0, start = NULL, end = NULL ) tramoseats_refresh( spec, refspec = NULL, policy = c("FreeParameters", "Complete", "Outliers_StochasticComponent", "Outliers", "FixedParameters", "FixedAutoRegressiveParameters", "Fixed", "Current"), period = 0, start = NULL, end = NULL )
tramo_refresh( spec, refspec = NULL, policy = c("FreeParameters", "Complete", "Outliers_StochasticComponent", "Outliers", "FixedParameters", "FixedAutoRegressiveParameters", "Fixed", "Current"), period = 0, start = NULL, end = NULL ) tramoseats_refresh( spec, refspec = NULL, policy = c("FreeParameters", "Complete", "Outliers_StochasticComponent", "Outliers", "FixedParameters", "FixedAutoRegressiveParameters", "Fixed", "Current"), period = 0, start = NULL, end = NULL )
spec |
the current specification to be refreshed ( |
refspec |
the reference specification used to define the domain
considered for re-estimation ( |
policy |
the refresh policy to apply (see details). |
period , start , end
|
additional parameters used to specify the span on
which additive outliers (AO) are introduced when |
The selection of constraints to be kept fixed or re-estimated is called a revision policy. User-defined parameters are always copied to the new refreshed specifications. This revision applies to the estimation done in Tramo (pre-adjustment phase), Seats will then run a new decomposition which might be in some (rare) cases based on a different model.
Available refresh policies are:
Current: applying the current pre-adjustment reg-arima model and handling the new raw data points, or any sub-span of the series as Additive Outliers (defined as new intervention variables)
Fixed: applying the current pre-adjustment reg-arima model and replacing forecasts by new raw data points.
FixedParameters: pre-adjustment reg-arima model is partially modified: regression coefficients will be re-estimated but regression variables, Arima orders and coefficients are unchanged.
FixedAutoRegressiveParameters: same as FixedParameters but Arima Moving Average coefficients (MA) are also re-estimated, Auto-regressive (AR) coefficients are kept fixed.
FreeParameters: all regression and Arima model coefficients are re-estimated, regression variables and Arima orders are kept fixed.
Outliers: regression variables and Arima orders are kept fixed, but outliers will be re-detected on the defined span, thus all regression and Arima model coefficients are re-estimated
Outliers_StochasticComponent: same as "Outliers" but Arima model orders (p,d,q)(P,D,Q) can also be re-identified.
a new specification, an object of class "JD3_TRAMOSEATS_SPEC"
or
"JD3_TRAMO_SPEC"
.
More information on revision policies in JDemetra+ online documentation: https://jdemetra-new-documentation.netlify.app/t-rev-policies-production
y <- rjd3toolkit::ABS$X0.2.08.10.M # raw series for first estimation y_raw <- window(y, end = c(2016, 12)) # raw series for second (refreshed) estimation y_new <- window(y, end = c(2017, 6)) # specification for first estimation spec_tramoseats_1 <- tramoseats_spec("rsafull") # first estimation sa_tramoseats <- tramoseats(y_raw, spec_tramoseats_1) # refreshing the specification current_result_spec <- sa_tramoseats$result_spec current_domain_spec <- sa_tramoseats$estimation_spec # policy = "Fixed" spec_tramoseats_ref <- tramoseats_refresh(current_result_spec, # point spec to be refreshed current_domain_spec, # domain spec (set of constraints) policy = "Fixed" ) # 2nd estimation with refreshed specification sa_tramoseats_ref <- tramoseats(y_new, spec_tramoseats_ref) # policy = "Outliers" spec_tramoseats_ref <- tramoseats_refresh(current_result_spec, current_domain_spec, policy = "Outliers", period = 12, start = c(2017, 1) ) # outliers will be re-detected from January 2017 included # 2nd estimation with refreshed specification sa_tramoseats_ref <- tramoseats(y_new, spec_tramoseats_ref) # policy = "Current" spec_tramoseats_ref <- tramoseats_refresh(current_result_spec, current_domain_spec, policy = "Current", period = 12, start = c(2017, 1), end = end(y_new) ) # points from January 2017 (included) until the end of the series will be treated # as Additive Outliers, the previous reg-Arima model being otherwise kept fixed # 2nd estimation with refreshed specification sa_tramoseats_ref <- tramoseats(y_new, spec_tramoseats_ref) #'
y <- rjd3toolkit::ABS$X0.2.08.10.M # raw series for first estimation y_raw <- window(y, end = c(2016, 12)) # raw series for second (refreshed) estimation y_new <- window(y, end = c(2017, 6)) # specification for first estimation spec_tramoseats_1 <- tramoseats_spec("rsafull") # first estimation sa_tramoseats <- tramoseats(y_raw, spec_tramoseats_1) # refreshing the specification current_result_spec <- sa_tramoseats$result_spec current_domain_spec <- sa_tramoseats$estimation_spec # policy = "Fixed" spec_tramoseats_ref <- tramoseats_refresh(current_result_spec, # point spec to be refreshed current_domain_spec, # domain spec (set of constraints) policy = "Fixed" ) # 2nd estimation with refreshed specification sa_tramoseats_ref <- tramoseats(y_new, spec_tramoseats_ref) # policy = "Outliers" spec_tramoseats_ref <- tramoseats_refresh(current_result_spec, current_domain_spec, policy = "Outliers", period = 12, start = c(2017, 1) ) # outliers will be re-detected from January 2017 included # 2nd estimation with refreshed specification sa_tramoseats_ref <- tramoseats(y_new, spec_tramoseats_ref) # policy = "Current" spec_tramoseats_ref <- tramoseats_refresh(current_result_spec, current_domain_spec, policy = "Current", period = 12, start = c(2017, 1), end = end(y_new) ) # points from January 2017 (included) until the end of the series will be treated # as Additive Outliers, the previous reg-Arima model being otherwise kept fixed # 2nd estimation with refreshed specification sa_tramoseats_ref <- tramoseats(y_new, spec_tramoseats_ref) #'
SEATS Decomposition
seats_decompose( sarima, seas.tolerance = 2, trend.boundary = 0.5, seas.boundary = 0.8, seas.boundary.unique = 0.8, approximation = c("None", "Legacy", "Noisy") )
seats_decompose( sarima, seas.tolerance = 2, trend.boundary = 0.5, seas.boundary = 0.8, seas.boundary.unique = 0.8, approximation = c("None", "Legacy", "Noisy") )
sarima |
SARIMA model (see |
seas.tolerance |
numeric: the seasonal tolerance (epsphi). The tolerance (measured in degrees) to allocate the AR non-real roots to the seasonal component (if the modulus of the inverse complex AR root is greater than the trend boundary and the frequency of this root differs from one of the seasonal frequencies by less than Seasonal tolerance) or the transitory component (otherwise). Possible values in [0,10]. Default value 2. |
trend.boundary |
numeric: the trend boundary (rmod). The boundary beyond which an AR root is integrated in the trend component. If the modulus of the inverse real root is greater than the trend boundary, the AR root is integrated in the trend component. Below this value, the root is integrated in the transitory component. Possible values [0,1]. Default = 0.5. |
seas.boundary |
numeric: the seasonal boundary (sbound). The boundary beyond which a real negative AR root is integrated in the seasonal component. If the modulus of the inverse negative real root is greater (or equal) than Seasonal boundary, the AR root is integrated into the seasonal component. Otherwise the root is integrated into the trend or transitory component. Possible values [0,1]. Default=0.8. |
seas.boundary.unique |
numeric: the seasonal boundary (unique), (sboundatpi). The boundary beyond which a negative AR root is integrated in the seasonal component, when the root is the unique seasonal root. If the modulus of the inverse negative real root is greater (or equal) than Seasonal boundary, the AR root is integrated into the seasonal component. Otherwise the root is integrated into the trend or transitory component. Possible values [0,1]. Default=0.8. |
approximation |
character: the approximation mode.
When the ARIMA model estimated by TRAMO does not accept an admissible
decomposition, SEATS:
|
seats_decompose(rjd3toolkit::sarima_model(period = 12, phi = c(0, 1), bd = 1))
seats_decompose(rjd3toolkit::sarima_model(period = 12, phi = c(0, 1), bd = 1))
Function allowing to customize parameters in the decomposition part (Seats) of a Tramo-Seats seasonal adjustment process. (Seats is an Arima Model Based decomposition algorithm working in conjunction with Tramo.)
set_seats( x, approximation = c(NA, "None", "Legacy", "Noisy"), trend.boundary = NA, seas.boundary = NA, seas.boundary.unique = NA, seas.tolerance = NA, ma.boundary = NA, fcasts = NA, bcasts = NA, algorithm = c(NA, "Burman", "KalmanSmoother"), bias = NA )
set_seats( x, approximation = c(NA, "None", "Legacy", "Noisy"), trend.boundary = NA, seas.boundary = NA, seas.boundary.unique = NA, seas.tolerance = NA, ma.boundary = NA, fcasts = NA, bcasts = NA, algorithm = c(NA, "Burman", "KalmanSmoother"), bias = NA )
x |
the specification to be modified, object of class |
approximation |
character: the approximation mode.
When the ARIMA model estimated by TRAMO does not accept an admissible
decomposition, SEATS:
|
trend.boundary |
numeric: the trend boundary (rmod). The boundary beyond which an AR root is integrated in the trend component. If the modulus of the inverse real root is greater than the trend boundary, the AR root is integrated in the trend component. Below this value, the root is integrated in the transitory component. Possible values [0,1]. Default = 0.5. |
seas.boundary |
numeric: the seasonal boundary (sbound). The boundary beyond which a real negative AR root is integrated in the seasonal component. If the modulus of the inverse negative real root is greater (or equal) than Seasonal boundary, the AR root is integrated into the seasonal component. Otherwise the root is integrated into the trend or transitory component. Possible values [0,1]. Default=0.8. |
seas.boundary.unique |
numeric: the seasonal boundary (unique), (sboundatpi). The boundary beyond which a negative AR root is integrated in the seasonal component, when the root is the unique seasonal root. If the modulus of the inverse negative real root is greater (or equal) than Seasonal boundary, the AR root is integrated into the seasonal component. Otherwise the root is integrated into the trend or transitory component. Possible values [0,1]. Default=0.8. |
seas.tolerance |
numeric: the seasonal tolerance (epsphi). The tolerance (measured in degrees) to allocate the AR non-real roots to the seasonal component (if the modulus of the inverse complex AR root is greater than the trend boundary and the frequency of this root differs from one of the seasonal frequencies by less than Seasonal tolerance) or the transitory component (otherwise). Possible values in [0,10]. Default value 2. |
ma.boundary |
numeric: the MA unit root boundary. When the modulus of an estimated MA root falls in the range [xl, 1], it is set to xl. Possible values [0.9,1]. Default=0.95. |
bcasts , fcasts
|
numeric: the number of backasts ( |
algorithm |
character: the estimation method for the unobserved components. The choice can be made from:
|
bias |
TODO. |
an object of class "JD3_TRAMOSEATS_SPEC"
.
More information and examples related to 'JDemetra+' features in the online documentation: https://jdemetra-new-documentation.netlify.app/
init_spec <- tramoseats_spec("rsafull") new_spec <- set_seats(init_spec, approximation = "Legacy", trend.boundary = 0.8, seas.boundary = 0.5, fcasts = -3, algorithm = "KalmanSmoother", bias = TRUE ) y <- rjd3toolkit::ABS$X0.2.09.10.M sa <- tramoseats(y, spec = new_spec)
init_spec <- tramoseats_spec("rsafull") new_spec <- set_seats(init_spec, approximation = "Legacy", trend.boundary = 0.8, seas.boundary = 0.5, fcasts = -3, algorithm = "KalmanSmoother", bias = TRUE ) y <- rjd3toolkit::ABS$X0.2.09.10.M sa <- tramoseats(y, spec = new_spec)
TRAMO for ERRORs (TERROR) controls the quality of the data by checking outliers at the end of the series
terror( ts, spec = c("trfull", "tr0", "tr1", "tr2", "tr3", "tr4", "tr5"), nback = 1, context = NULL )
terror( ts, spec = c("trfull", "tr0", "tr1", "tr2", "tr3", "tr4", "tr5"), nback = 1, context = NULL )
ts |
a univariate time series. |
spec |
the model specification. Can be either the name of a predefined specification or a user-defined specification. |
nback |
number of last observations considered for the quality check. |
context |
the dictionnary of variables. |
a mts
object with 7 variables:
actual
the actual data at the end of the series.
forecast
the forecast of the actual data at the end of the series.
error
the absolute errors (= observed - forecasts).
rel.error
relative errors ("scores") : ratios between the forecast
errors and the standard deviation of the forecasts of the last observations
(positive values mean under-estimation).
raw
the transformed series. More especially, if the chosen model implies
a log-transformation, the values are obtained after a log-transformation.
Other transformations, such leap year corrections or length-of periods corrections may also be used.
fraw
the forecast of the transformed series.
efraw
the absolute errors of the transformed series.
terror(rjd3toolkit::ABS$X0.2.09.10.M, nback = 2)
terror(rjd3toolkit::ABS$X0.2.09.10.M, nback = 2)
TRAMO model, pre-adjustment in TRAMO-SEATS
tramo( ts, spec = c("trfull", "tr0", "tr1", "tr2", "tr3", "tr4", "tr5"), context = NULL, userdefined = NULL ) tramo_fast( ts, spec = c("trfull", "tr0", "tr1", "tr2", "tr3", "tr4", "tr5"), context = NULL, userdefined = NULL )
tramo( ts, spec = c("trfull", "tr0", "tr1", "tr2", "tr3", "tr4", "tr5"), context = NULL, userdefined = NULL ) tramo_fast( ts, spec = c("trfull", "tr0", "tr1", "tr2", "tr3", "tr4", "tr5"), context = NULL, userdefined = NULL )
ts |
a univariate time series. |
spec |
the model specification. Can be either the name of a predefined specification or a user-defined specification. |
context |
the dictionnary of variables. |
userdefined |
a vector containing the additional output variables
(see |
the tramo()
function returns a list with the results
("JD3_regarima_rslts"
object), the estimation specification and the result
specification, while tramo_fast()
is a faster function that only returns
the results.
library("rjd3toolkit") y <- rjd3toolkit::ABS$X0.2.09.10.M sp <- tramo_spec("trfull") sp <- add_outlier(sp, type = c("AO"), c("2015-01-01", "2010-01-01") ) tramo_fast(y, spec = sp) sp <- set_transform( set_tradingdays( set_easter(sp, enabled = FALSE), option = "workingdays" ), fun = "None" ) tramo_fast(y, spec = sp) sp <- set_outlier(sp, outliers.type = c("AO")) tramo_fast(y, spec = sp)
library("rjd3toolkit") y <- rjd3toolkit::ABS$X0.2.09.10.M sp <- tramo_spec("trfull") sp <- add_outlier(sp, type = c("AO"), c("2015-01-01", "2010-01-01") ) tramo_fast(y, spec = sp) sp <- set_transform( set_tradingdays( set_easter(sp, enabled = FALSE), option = "workingdays" ), fun = "None" ) tramo_fast(y, spec = sp) sp <- set_outlier(sp, outliers.type = c("AO")) tramo_fast(y, spec = sp)
Forecasts with TRAMO
tramo_forecast( ts, spec = c("trfull", "tr0", "tr1", "tr2", "tr3", "tr4", "tr5"), nf = -1, context = NULL )
tramo_forecast( ts, spec = c("trfull", "tr0", "tr1", "tr2", "tr3", "tr4", "tr5"), nf = -1, context = NULL )
ts |
a univariate time series. |
spec |
the model specification. Can be either the name of a predefined specification or a user-defined specification. |
nf |
the forecasting horizon ( |
context |
the dictionnary of variables. |
a mts
object with 7 variables:
forecast
the forecast of the actual data at the end of the series.
error
standard deviation of the forecast.
fraw
the forecast of the transformed series.
efraw
the standard deviation of the forecast of the transformed series.
tramo_forecast(rjd3toolkit::ABS$X0.2.09.10.M)
tramo_forecast(rjd3toolkit::ABS$X0.2.09.10.M)
Tramo is a particular regarima model estimation algorithm, mainly used to linearized the series before performing a decomposition with Seats
tramo_outliers( y, order = c(0L, 1L, 1L), seasonal = c(0L, 1L, 1L), mean = FALSE, X = NULL, X.td = NULL, ao = TRUE, ls = TRUE, tc = FALSE, so = FALSE, cv = 0, ml = FALSE, clean = FALSE )
tramo_outliers( y, order = c(0L, 1L, 1L), seasonal = c(0L, 1L, 1L), mean = FALSE, X = NULL, X.td = NULL, ao = TRUE, ls = TRUE, tc = FALSE, so = FALSE, cv = 0, ml = FALSE, clean = FALSE )
y |
the dependent variable (a |
order , seasonal
|
the orders of the ARIMA model. |
mean |
Boolean to include or not the mean. |
X |
user defined regressors (other than calendar). |
X.td |
calendar regressors. |
ao , ls , so , tc
|
Boolean to indicate which type of outliers should be detected. |
cv |
|
ml |
Use of maximum likelihood (otherwise approximation by means of Hannan-Rissanen). |
clean |
Clean missing values at the beginning/end of the series. Regression variables are automatically resized, if need be. |
a "JD3_REGARIMA_OUTLIERS"
object.
tramo_outliers(rjd3toolkit::ABS$X0.2.09.10.M)
tramo_outliers(rjd3toolkit::ABS$X0.2.09.10.M)
Seasonal Adjustment with TRAMO-SEATS
tramoseats( ts, spec = c("rsafull", "rsa0", "rsa1", "rsa2", "rsa3", "rsa4", "rsa5"), context = NULL, userdefined = NULL ) tramoseats_fast( ts, spec = c("rsafull", "rsa0", "rsa1", "rsa2", "rsa3", "rsa4", "rsa5"), context = NULL, userdefined = NULL ) .jtramoseats( ts, spec = c("rsafull", "rsa0", "rsa1", "rsa2", "rsa3", "rsa4", "rsa5"), context = NULL, userdefined = NULL )
tramoseats( ts, spec = c("rsafull", "rsa0", "rsa1", "rsa2", "rsa3", "rsa4", "rsa5"), context = NULL, userdefined = NULL ) tramoseats_fast( ts, spec = c("rsafull", "rsa0", "rsa1", "rsa2", "rsa3", "rsa4", "rsa5"), context = NULL, userdefined = NULL ) .jtramoseats( ts, spec = c("rsafull", "rsa0", "rsa1", "rsa2", "rsa3", "rsa4", "rsa5"), context = NULL, userdefined = NULL )
ts |
a univariate time series. |
spec |
the model specification. Can be either the name of a predefined specification or a user-defined specification. |
context |
the dictionnary of variables. |
userdefined |
a vector containing the additional output variables
(see |
The tramoseats()
function returns a list with the results, the
estimation specification and the result specification, while
tramoseats_fast()
is a faster function that only returns the results.
The .jtramoseats()
functions only results the java object to custom outputs
in other packages (use rjd3toolkit::dictionary()
to get the list of
variables and rjd3toolkit::result()
to get a specific variable).
library("rjd3toolkit") sp <- tramoseats_spec("rsafull") y <- rjd3toolkit::ABS$X0.2.09.10.M tramoseats_fast(y, spec = sp) sp <- add_outlier(sp, type = c("AO"), c("2015-01-01", "2010-01-01") ) sp <- set_transform( set_tradingdays( set_easter(sp, enabled = FALSE), option = "workingdays" ), fun = "None" ) tramoseats_fast(y, spec = sp)
library("rjd3toolkit") sp <- tramoseats_spec("rsafull") y <- rjd3toolkit::ABS$X0.2.09.10.M tramoseats_fast(y, spec = sp) sp <- add_outlier(sp, type = c("AO"), c("2015-01-01", "2010-01-01") ) sp <- set_transform( set_tradingdays( set_easter(sp, enabled = FALSE), option = "workingdays" ), fun = "None" ) tramoseats_fast(y, spec = sp)
TRAMO-SEATS Dictionary
tramoseats_dictionary()
tramoseats_dictionary()
A vector containing the names of all the available output objects (series, diagnostics, parameters).
Compute revisions history
tramoseats_revisions( ts, spec, data_ids = NULL, ts_ids = NULL, cmp_ids = NULL, context = NULL )
tramoseats_revisions( ts, spec, data_ids = NULL, ts_ids = NULL, cmp_ids = NULL, context = NULL )
ts |
The time series used for the estimation. |
spec |
The specification used. |
data_ids |
A |
ts_ids |
A |
cmp_ids |
A |
context |
The context of the specification. |
s <- rjd3toolkit::ABS$X0.2.09.10.M sa_mod <- tramoseats(s) data_ids <- list( # Get the coefficient of the trading-day coefficient from 2005-jan list(start = "2005-01-01", id = "regression.td(1)"), # Get the ljung-box statistics on residuals from 2010-jan list(start = "2010-01-01", id = "residuals.lb") ) ts_ids <- list( # Get the SA component estimates of 2010-jan from 2010-jan list(period = "2010-01-01", start = "2010-01-01", id = "sa"), # Get the irregular component estimates of 2010-jan from 2015-jan list(period = "2010-01-01", start = "2015-01-01", id = "i") ) cmp_ids <- list( # Get the SA component estimates (full time series) 2010-jan to 2020-jan list(start = "2010-01-01", end = "2020-01-01", id = "sa"), # Get the trend component estimates (full time series) 2010-jan to 2020-jan list(start = "2010-01-01", end = "2020-01-01", id = "t") ) rh <- tramoseats_revisions(s, sa_mod$result_spec, data_ids, ts_ids, cmp_ids)
s <- rjd3toolkit::ABS$X0.2.09.10.M sa_mod <- tramoseats(s) data_ids <- list( # Get the coefficient of the trading-day coefficient from 2005-jan list(start = "2005-01-01", id = "regression.td(1)"), # Get the ljung-box statistics on residuals from 2010-jan list(start = "2010-01-01", id = "residuals.lb") ) ts_ids <- list( # Get the SA component estimates of 2010-jan from 2010-jan list(period = "2010-01-01", start = "2010-01-01", id = "sa"), # Get the irregular component estimates of 2010-jan from 2015-jan list(period = "2010-01-01", start = "2015-01-01", id = "i") ) cmp_ids <- list( # Get the SA component estimates (full time series) 2010-jan to 2020-jan list(start = "2010-01-01", end = "2020-01-01", id = "sa"), # Get the trend component estimates (full time series) 2010-jan to 2020-jan list(start = "2010-01-01", end = "2020-01-01", id = "t") ) rh <- tramoseats_revisions(s, sa_mod$result_spec, data_ids, ts_ids, cmp_ids)
Set of functions(tramoseats_spec()
,tramo_spec()
) to create default specifications associated with the TRAMO-SEATS seasonal adjustment method.
Specification creation can be restricted to the tramo part with the tramo_spec()
function.
tramo_spec(name = c("trfull", "tr0", "tr1", "tr2", "tr3", "tr4", "tr5")) tramoseats_spec( name = c("rsafull", "rsa0", "rsa1", "rsa2", "rsa3", "rsa4", "rsa5") )
tramo_spec(name = c("trfull", "tr0", "tr1", "tr2", "tr3", "tr4", "tr5")) tramoseats_spec( name = c("rsafull", "rsa0", "rsa1", "rsa2", "rsa3", "rsa4", "rsa5") )
name |
the name of a predefined specification. |
Without argument tramo_spec()
yields a TR5 specification
without argument tramoseats_spec()
yields a RSA5 specification
The available predefined 'JDemetra+' model specifications are described in the table below:
Identifier | | Log/level detection | | Outliers detection | | Calendar effects | | ARIMA |
RSA0/TR0 | | NA | | NA | | NA | | Airline(+mean) |
RSA1/TR1 | | automatic | | AO/LS/TC | | NA | | Airline(+mean) |
RSA2/TR2 | | automatic | | AO/LS/TC | | 2 td vars + Easter | | Airline(+mean) |
RSA3/TR3 | | automatic | | AO/LS/TC | | NA | | automatic |
RSA4/TR3 | | automatic | | AO/LS/TC | | 2 td vars + Easter | | automatic |
RSA5/TR5 | | automatic | | AO/LS/TC | | 7 td vars + Easter | | automatic |
RSAfull/TRfull | | automatic | | AO/LS/TC | | automatic | | automatic |
an object of class "JD3_TRAMOSEATS_SPEC"
(tramoseats_spec()
) or
"JD3_TRAMO_SPEC"
(tramo_spec()
).
To set the pre-processing parameters:
rjd3toolkit::set_arima()
, rjd3toolkit::set_automodel()
,
rjd3toolkit::set_basic()
, rjd3toolkit::set_easter()
,
rjd3toolkit::set_estimate()
, rjd3toolkit::set_outlier()
,
rjd3toolkit::set_tradingdays()
, rjd3toolkit::set_transform()
,
rjd3toolkit::add_outlier()
, rjd3toolkit::remove_outlier()
,
rjd3toolkit::add_ramp()
, rjd3toolkit::remove_ramp()
,
rjd3toolkit::add_usrdefvar()
.
To set the decomposition parameters: set_seats()
.
To set the benchmarking parameters: rjd3toolkit::set_benchmarking()
.
init_spec <- tramoseats_spec() init_spec <- tramo_spec() init_spec <- tramoseats_spec("rsa3") init_spec <- tramo_spec("tr3")
init_spec <- tramoseats_spec() init_spec <- tramo_spec() init_spec <- tramoseats_spec("rsa3") init_spec <- tramo_spec("tr3")
Function generating a comprehensive list of available output variables from the estimation process
by the tramo()
and tramoseats()
functions.
Some items are available in the default estimation output but the remainder can be added
using the userdefined
parameter.
User-defined objects can the be retrieved from the list of lists generated by the estimation process
userdefined_variables_tramoseats(x = c("TRAMO-SEATS", "TRAMO"))
userdefined_variables_tramoseats(x = c("TRAMO-SEATS", "TRAMO"))
x |
a character to indicate the estimation function for which the output items list will be displayed. |
a vector containing the names of all the available output objects (series, diagnostics, parameters)
More information and examples related to 'JDemetra+' features in the online documentation: https://jdemetra-new-documentation.netlify.app/
userdefined_variables_tramoseats("tramoseats") userdefined_variables_tramoseats("tramo") y <- rjd3toolkit::ABS$X0.2.09.10.M m <- tramoseats(y, "rsafull", userdefined = c("ycal", "variancedecomposition.seasonality")) m$user_defined$ycal m$user_defined$variancedecomposition.seasonality
userdefined_variables_tramoseats("tramoseats") userdefined_variables_tramoseats("tramo") y <- rjd3toolkit::ABS$X0.2.09.10.M m <- tramoseats(y, "rsafull", userdefined = c("ycal", "variancedecomposition.seasonality")) m$user_defined$ycal m$user_defined$variancedecomposition.seasonality