Skip to contents

RegARIMA model, pre-adjustment in X13

Usage

regarima(
  ts,
  spec = c("rg4", "rg0", "rg1", "rg2c", "rg3", "rg5c"),
  context = NULL,
  userdefined = NULL
)

regarima_fast(
  ts,
  spec = c("rg4", "rg0", "rg1", "rg2c", "rg3", "rg5c"),
  context = NULL,
  userdefined = NULL
)

Arguments

ts

an univariate time series.

spec

the model specification. Can be either the name of a predefined specification or a user-defined specification.

context

list of external regressors (calendar or other) to be used for estimation

userdefined

a vector containing additional output variables (see x13_dictionary()).

Value

the regarima() function returns a list with the results ("JD3_REGARIMA_RSLTS" object), the estimation specification and the result specification, while regarima_fast() is a faster function that only returns the results.

Examples

y = rjd3toolkit::ABS$X0.2.09.10.M
sp = regarima_spec("rg5c")
sp = rjd3toolkit::add_outlier(sp,
                 type = c("AO"), c("2015-01-01", "2010-01-01"))
regarima_fast(y, spec = sp)
#> Log-transformation: yes 
#> SARIMA model:  (0,1,1) (1,1,1)
#> 
#> Coefficients
#>           Estimate Std. Error T-stat
#> theta(1)  -0.81606    0.06959 -11.73
#> bphi(1)   -0.43734    0.02661 -16.44
#> btheta(1) -0.82509    0.04481 -18.41
#> 
#> Regression model:
#>                  Estimate Std. Error T-stat
#> monday          -0.008747   0.003287 -2.661
#> tuesday          0.004488   0.003314  1.354
#> wednesday       -0.001471   0.003294 -0.447
#> thursday         0.013886   0.003325  4.176
#> friday          -0.001944   0.003325 -0.585
#> saturday         0.015368   0.003304  4.651
#> easter           0.051130   0.006621  7.723
#> AO (2010-01-01)  0.035349   0.028796  1.228
#> AO (2015-01-01) -0.020385   0.028885 -0.706
#> TC (2000-06-01)  0.162169   0.026510  6.117
#> AO (2000-07-01) -0.306536   0.032095 -9.551
#> Number of observations:  425 
#> Number of effective observations:  412 
#> Number of parameters:  15 
#> 
#> Loglikelihood:  795.8429 
#> Adjusted loglikelihood:  -2071.784 
#> 
#> Standard error of the regression (ML estimate):  0.03478056 
#> AIC:  4173.568 
#> AICC:  4174.78 
#> BIC:  4233.883 
#> 
sp = rjd3toolkit::set_transform(
   rjd3toolkit::set_tradingdays(
     rjd3toolkit::set_easter(sp, enabled = FALSE),
    option = "workingdays"
  ),
  fun = "None"
)
regarima_fast(y, spec = sp)
#> Log-transformation: no 
#> SARIMA model:  (3,1,1) (0,1,1)
#> 
#> Coefficients
#>           Estimate Std. Error  T-stat
#> phi(1)     0.16557    0.06461   2.563
#> phi(2)     0.08780    0.06435   1.364
#> phi(3)    -0.11287    0.06047  -1.867
#> theta(1)  -0.86076    0.03927 -21.918
#> btheta(1) -0.22918    0.05193  -4.413
#> 
#> Regression model:
#>                  Estimate Std. Error T-stat
#> td                 1.0015     0.8098  1.237
#> lp                29.6392    11.5469  2.567
#> AO (2010-01-01)   37.0476    34.4300  1.076
#> AO (2015-01-01)   27.9946    35.0234  0.799
#> AO (2000-06-01)  199.7536    34.5756  5.777
#> AO (2000-07-01) -194.6887    34.6240 -5.623
#> LS (2005-04-01)  -82.3062    17.4210 -4.725
#> LS (2015-07-01)   81.3334    18.0924  4.495
#> Number of observations:  425 
#> Number of effective observations:  412 
#> Number of parameters:  14 
#> 
#> Loglikelihood:  -2159.902 
#> Standard error of the regression (ML estimate):  45.632 
#> AIC:  4347.804 
#> AICC:  4348.862 
#> BIC:  4404.099 
#> 
sp =  rjd3toolkit::set_outlier(sp, outliers.type = c("AO"))
regarima_fast(y, spec = sp)
#> Log-transformation: no 
#> SARIMA model:  (3,1,1) (0,1,1)
#> 
#> Coefficients
#>           Estimate Std. Error  T-stat
#> phi(1)     0.11808    0.09633   1.226
#> phi(2)     0.03364    0.09199   0.366
#> phi(3)    -0.15061    0.08002  -1.882
#> theta(1)  -0.83611    0.07714 -10.838
#> btheta(1) -0.24114    0.05412  -4.456
#> 
#> Regression model:
#>                  Estimate Std. Error T-stat
#> td                 1.0012     0.8028  1.247
#> lp                30.8981    11.7820  2.622
#> AO (2010-01-01)   37.2796    35.1800  1.060
#> AO (2015-01-01)    6.5622    35.1307  0.187
#> AO (2000-06-01)  194.6157    35.1753  5.533
#> AO (2000-07-01) -201.1923    35.2286 -5.711
#> AO (2005-04-01) -150.2768    35.1047 -4.281
#> Number of observations:  425 
#> Number of effective observations:  412 
#> Number of parameters:  13 
#> 
#> Loglikelihood:  -2169.985 
#> Standard error of the regression (ML estimate):  46.77874 
#> AIC:  4365.971 
#> AICC:  4366.885 
#> BIC:  4418.244 
#>