regarima: RegARIMA model, pre-adjustment in X13 and TRAMO-SEATS

View source: R/regarima.R

regarimaR Documentation

RegARIMA model, pre-adjustment in X13 and TRAMO-SEATS

Description

The regarima/regarima_x13/regarima_tramoseats functions remove deterministic effects from the input series (e.g.calendar effects, outliers) using a multivariate regression model with arima errors. The jregarima/jregarima_x13/jregarima_tramoseats functions do the same computation but return the Java objects instead of a formatted output.

Usage

jregarima(series, spec = NA)

jregarima_tramoseats(
  series,
  spec = c("TRfull", "TR0", "TR1", "TR2", "TR3", "TR4", "TR5")
)

jregarima_x13(series, spec = c("RG5c", "RG0", "RG1", "RG2c", "RG3", "RG4c"))

regarima(series, spec = NA)

regarima_tramoseats(
  series,
  spec = c("TRfull", "TR0", "TR1", "TR2", "TR3", "TR4", "TR5")
)

regarima_x13(series, spec = c("RG5c", "RG0", "RG1", "RG2c", "RG3", "RG4c"))

Arguments

series

an univariate time series

spec

the model specification. For the function:

  • regarima: an object of class c("regarima_spec","X13") or c("regarima_spec","TRAMO_SEATS"). See the functions regarima_spec_x13 and regarima_spec_tramoseats.

  • regarima_x13: the name of a predefined X13 'JDemetra+' model specification (see Details). The default value is "RG5c".

  • regarima_tramoseats:the name of a predefined TRAMO-SEATS 'JDemetra+' model specification (see Details). The default value is "TRfull".

Details

When seasonally adjusting with X13 and TRAMO-SEATS, the first step consists in pre-adjusting the original series with a RegARIMA model, where the original series is corrected for any deterministic effects and missing observations. This step is also referred to as the linearization of the original series.

The RegARIMA model (model with ARIMA errors) is specified as such:

z_t = y_t\beta + x_t

where:

  • z_t is the original series;

  • \beta = (\beta_1,...,\beta_n) is a vector of regression coefficients;

  • y_t = (y_{1t},...,y_{nt}) are n regression variables (outliers, calendar effects, user-defined variables);

  • x_t is a disturbance that follows the general ARIMA process: \phi(B)\delta(B)x_t = \theta(B)a_t; where \phi(B), \delta(B) and \theta(B) are finite polynomials in B and a_t is a white noise variable with zero mean and a constant variance.

The polynomial \phi(B) is a stationary autoregressive (AR) polynomial in B, which is a product of the stationary regular AR polynomial in B and the stationary seasonal polynomial in B^s:

\phi(B)=\phi_p(B)\Phi_{bp}(B^s)=(1+\phi_1B+...+\phi_pB^p)(1+\Phi_1B^s+...+\Phi_{bp}B^{bps})

where:

  • p is the number of regular AR terms (here and in 'JDemetra+', p \le 3);

  • bp is the number of seasonal AR terms (here and in 'JDemetra+', bp \le 1);

  • s is the number of observations per year (ie. The time series frequency).

The polynomial \theta(B) is an invertible moving average (MA) polynomial in B, which is a product of the invertible regular MA polynomial in B and the invertible seasonal MA polynomial in B^s:

\theta(B)=\theta_q(B)\Theta_{bq}(B^s)=(1+\theta_1B+...+\theta_qB^q)(1+\Theta_1B^s+...+\Theta_{bq}B^{bqs})

where:

  • q is the number of regular MA terms (here and in 'JDemetra+', q \le 3);

  • bq is the number of seasonal MA terms (here and in 'JDemetra+', bq \le 1).

The polynomial \delta(B) is the non-stationary AR polynomial in B (unit roots):

\delta(B) = (1-B)^d(1-B^s)^{d_s}

where:

  • d is the regular differencing order (here and in 'JDemetra+', d \le 1);

  • d_s is the seasonal differencing order (here and in 'JDemetra+', d_s \le 1).

NB. The notations used for AR and MA processes, as well as the model denoted as ARIMA (P,D,Q)(BP,BD,BQ), are consistent with those in 'JDemetra+'.

The available predefined 'JDemetra+' X13 and TRAMO-SEATS model specifications are described in the tables below:

X13:

Identifier | Log/level detection | Outliers detection | Calendar effects | ARIMA
RG0 | NA | NA | NA | Airline(+mean)
RG1 | automatic | AO/LS/TC | NA | Airline(+mean)
RG2c | automatic | AO/LS/TC | 2 td vars + Easter | Airline(+mean)
RG3 | automatic | AO/LS/TC | NA | automatic
RG4c | automatic | AO/LS/TC | 2 td vars + Easter | automatic
RG5c | automatic | AO/LS/TC | 7 td vars + Easter | automatic

TRAMO-SEATS:

Identifier | Log/level detection | Outliers detection | Calendar effects | ARIMA
TR0 | NA | NA | NA | Airline(+mean)
TR1 | automatic | AO/LS/TC | NA | Airline(+mean)
TR2 | automatic | AO/LS/TC | 2 td vars + Easter | Airline(+mean)
TR3 | automatic | AO/LS/TC | NA | automatic
TR4 | automatic | AO/LS/TC | 2 td vars + Easter | automatic
TR5 | automatic | AO/LS/TC | 7 td vars + Easter | automatic
TRfull | automatic | AO/LS/TC | automatic | automatic

Value

The jregarima/jregarima_x13/jregarima_tramoseats functions return a jSA object that contains the result of the pre-adjustment method without any formatting. Therefore, the computation is faster than with the regarima/regarima_x13/regarima_tramoseats functions. The results of the seasonal adjustment can be extracted with the function get_indicators.

The regarima/regarima_x13/regarima_tramoseats functions return an object of class "regarima" and sub-class "X13" or "TRAMO_SEATS". regarima_x13 returns an object of class c("regarima","X13") and regarima_tramoseats, an object of class c("regarima","TRAMO_SEATS"). For the function regarima, the sub-class of the object depends on the used method that is defined by the spec object class.

An object of class "regarima" is a list containing the following components:

specification

a list with the model specification as defined by the spec argument. See also the Value of the regarima_spec_x13 and regarima_spec_tramoseats functions.

arma

a vector containing the orders of the autoregressive (AR), moving average (MA), seasonal AR and seasonal MA processes, as well as the regular and seasonal differencing orders (P,D,Q) (BP,BD,BQ).

arima.coefficients

a matrix containing the estimated regular and seasonal AR and MA coefficients, as well as the associated standard errors and t-statistics values. The estimated coefficients can be also extracted with the function coef (whose output also includes the regression coefficients).

regression.coefficients

a matrix containing the estimated regression variables (i.e.: mean, calendar effect, outliers and user-defined regressors) coefficients, as well as the associated standard errors and t-statistics values. The estimated coefficients can be also extracted with the function coef (whose output also includes the arima coefficients).

loglik

a matrix containing the log-likelihood of the RegARIMA model as well as the associated model selection criteria statistics (AIC, AICC, BIC and BICC) and parameters (np = number of parameters in the likelihood, neffectiveobs = number of effective observations in the likelihood). These statistics can also be extracted with the function logLik.

model

a list containing information on the model specification after its estimation (spec_rslt), as well as the decomposed elements of the input series (ts matrix, effects). The model specification includes information on the estimation method (Model) and time span (T.span), whether the original series was log transformed (Log transformation) and details on the regression part of the RegARIMA model i.e. if it includes a Mean, Trading days effects (if so, it provides the number of regressors), Leap year effect, Easter effect and whether outliers were detected (Outliers (if so, it provides the number of outliers). The decomposed elements of the input series contain the linearised series (y_lin) and the deterministic components i.e.: trading days effect (tde), Easter effect (ee), other moving holidays effect (omhe) and outliers effect (total - out, related to irregular - out_i, related to trend - out_t, related to seasonal - out_s).

residuals

the residuals (time series). They can be also extracted with the function residuals.

residuals.stat

a list containing statistics on the RegARIMA residuals. It provides the residuals standard error (st.error) and the results of normality, independence and linearity of the residuals (tests) - object of class c("regarima_rtests","data.frame").

forecast

a ts matrix containing the forecast of the original series (fcst) and its standard error (fcsterr).

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.

Examples


 # X13 method
myseries <- ipi_c_eu[, "FR"]
myreg <- regarima_x13(myseries, spec ="RG5c")
summary(myreg)
plot(myreg)

myspec1 <- regarima_spec_x13(myreg, tradingdays.option = "WorkingDays")
myreg1 <- regarima(myseries, myspec1)

myspec2 <- regarima_spec_x13(myreg, 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")
myreg2 <- regarima(myseries, myspec2)
myreg2

myspec3 <- regarima_spec_x13(myreg, automdl.enabled = FALSE,
             arima.p = 1, arima.q = 1,
             arima.bp = 0, arima.bq = 1,
             arima.coefEnabled = TRUE,
             arima.coef = c(-0.8, -0.6, 0),
             arima.coefType = c(rep("Fixed", 2), "Undefined"))
s_arimaCoef(myspec3)
myreg3 <- regarima(myseries, myspec3)
summary(myreg3)
plot(myreg3)

 # TRAMO-SEATS method
myspec <- regarima_spec_tramoseats("TRfull")
myreg <- regarima(myseries, myspec)
myreg

myspec2 <- regarima_spec_tramoseats(myspec, tradingdays.mauto = "Unused",
             tradingdays.option = "WorkingDays",
             easter.type = "Standard",
             automdl.enabled = FALSE, arima.mu = TRUE)
myreg2 <- regarima(myseries, myspec2)

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)
myspec3 <- regarima_spec_tramoseats(myspec,
             usrdef.varEnabled = TRUE, usrdef.var = var)
s_preVar(myspec3)
myreg3 <- regarima(myseries, myspec3)
myreg3


RJDemetra documentation built on Oct. 19, 2023, 1:12 a.m.