Seasonal Adjustment with TRAMO-SEATS
Usage
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
)
Arguments
- 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
tramoseats_dictionary()
).
Value
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).
Examples
library("rjd3toolkit")
sp = tramoseats_spec("rsafull")
y = rjd3toolkit::ABS$X0.2.09.10.M
tramoseats_fast(y, spec = sp)
#> TRAMO
#> Log-transformation: yes
#> SARIMA model: (0,1,1) (0,1,1)
#>
#> Coefficients
#> Estimate Std. Error T-stat
#> theta(1) -0.82783 0.02571 -32.196
#> btheta(1) -0.42554 0.06388 -6.661
#>
#> Regression model:
#> Estimate Std. Error T-stat
#> monday -0.0109446 0.0034805 -3.145
#> tuesday 0.0048940 0.0035307 1.386
#> wednesday 0.0001761 0.0034970 0.050
#> thursday 0.0132928 0.0035330 3.763
#> friday -0.0024801 0.0035383 -0.701
#> saturday 0.0153509 0.0035171 4.365
#> lp 0.0410667 0.0101178 4.059
#> easter 0.0503888 0.0072698 6.931
#> AO (2000-06-01) 0.1681662 0.0299743 5.610
#> AO (2000-07-01) -0.1972348 0.0298664 -6.604
#> Number of observations: 425
#> Number of effective observations: 412
#> Number of parameters: 13
#>
#> Loglikelihood: 781.358
#> Adjusted loglikelihood: -2086.269
#>
#> Standard error of the regression (ML estimate): 0.03615788
#> AIC: 4198.538
#> AICC: 4199.452
#> BIC: 4250.811
#>
#>
#> Decomposition
#> model
#>
#> DIF: 1 -1 0 0 0 0 0 0 0 0 0 0 -1 1
#> MA: 1 -0.8278316 0 0 0 0 0 0 0 0 0 0 -0.4255409 0.3522762
#> var: 1
#>
#> trend
#>
#> DIF: 1 -2 1
#> MA: 1 0.06437327 -0.9356267
#> var: 0.004098184
#>
#> seasonal
#>
#> DIF: 1 1 1 1 1 1 1 1 1 1 1 1
#> MA: 1 0.6197472 0.3121522 0.07325877 -0.1026014 -0.2222985 -0.2934508 -0.3240296 -0.3220203 -0.295141 -0.2506158 -0.1950007
#> var: 0.1460322
#>
#> irregular
#>
#> var: 0.384587
#>
#>
#> Diagnostics
#> Relative contribution of the components to the stationary
#> portion of the variance in the original series,
#> after the removal of the long term trend (in %)
#>
#> Component
#> cycle 0.250
#> seasonal 97.046
#> irregular 0.600
#> calendar 0.741
#> others 0.325
#> total 98.962
#>
#> Residual seasonality tests
#> P.value
#> seas.ftest.i 1
#> seas.ftest.sa 1
#> seas.qstest.i 1
#> seas.qstest.sa 1
#> td.ftest.i 1
#> td.ftest.sa 1
#>
#>
#> Final
#> Last values
#> series sa trend seas irr
#> Sep 2016 1393.5 1552.616 1561.206 0.8975174 0.9944979
#> Oct 2016 1497.4 1568.366 1559.217 0.9547514 1.0058681
#> Nov 2016 1684.3 1528.962 1557.382 1.1015974 0.9817508
#> Dec 2016 2850.4 1542.997 1556.132 1.8473143 0.9915588
#> Jan 2017 1428.5 1545.950 1555.502 0.9240275 0.9938587
#> Feb 2017 1092.4 1551.369 1555.210 0.7041521 0.9975303
#> Mar 2017 1370.3 1553.207 1555.087 0.8822391 0.9987913
#> Apr 2017 1522.6 1580.752 1554.759 0.9632123 1.0167187
#> May 2017 1452.4 1554.517 1553.908 0.9343093 1.0003924
#> Jun 2017 1557.2 1551.804 1552.778 1.0034774 0.9993726
#> Jul 2017 1445.5 1544.701 1551.717 0.9357801 0.9954781
#> Aug 2017 1303.1 1535.588 1550.949 0.8485999 0.9900960
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
#> Log-transformation: no
#> SARIMA model: (0,1,1) (0,1,1)
#>
#> Coefficients
#> Estimate Std. Error T-stat
#> theta(1) -0.82355 0.02896 -28.43
#> btheta(1) -0.26081 0.04903 -5.32
#>
#> Regression model:
#> Estimate Std. Error T-stat
#> monday -11.7873 3.8750 -3.042
#> tuesday 0.2507 3.8786 0.065
#> wednesday 3.0039 3.8746 0.775
#> thursday 12.8309 3.9423 3.255
#> friday -5.4519 3.9132 -1.393
#> saturday 17.2998 3.9274 4.405
#> lp 33.6083 11.2479 2.988
#> AO (2010-01-01) 40.5331 33.7485 1.201
#> AO (2015-01-01) -10.7096 33.7815 -0.317
#> AO (2000-06-01) 192.7411 33.9640 5.675
#> AO (2000-07-01) -200.7316 33.7986 -5.939
#> AO (2005-04-01) -177.1356 33.7257 -5.252
#> Number of observations: 425
#> Number of effective observations: 412
#> Number of parameters: 15
#>
#> Loglikelihood: -2139.74
#> Standard error of the regression (ML estimate): 43.47307
#> AIC: 4309.481
#> AICC: 4310.693
#> BIC: 4369.796
#>
#>
#> Decomposition
#> model
#>
#> DIF: 1 -1 0 0 0 0 0 0 0 0 0 0 -1 1
#> MA: 1 -0.8235461 0 0 0 0 0 0 0 0 0 0 -0.2608057 0.2147855
#> var: 1
#>
#> trend
#>
#> DIF: 1 -2 1
#> MA: 1 0.09197092 -0.9080291
#> var: 0.003491855
#>
#> seasonal
#>
#> DIF: 1 1 1 1 1 1 1 1 1 1 1 1
#> MA: 1 0.6220678 0.315157 0.07593327 -0.1008043 -0.2215881 -0.2938052 -0.3252816 -0.3239249 -0.2974269 -0.2530226 -0.1973046
#> var: 0.240472
#>
#> irregular
#>
#> var: 0.2654024
#>
#>
#> Diagnostics
#> Relative contribution of the components to the stationary
#> portion of the variance in the original series,
#> after the removal of the long term trend (in %)
#>
#> Component
#> cycle 0.198
#> seasonal 98.409
#> irregular 0.223
#> calendar 0.246
#> others 0.257
#> total 99.333
#>
#> Residual seasonality tests
#> P.value
#> seas.ftest.i 1
#> seas.ftest.sa 1
#> seas.qstest.i 1
#> seas.qstest.sa 1
#> td.ftest.i 1
#> td.ftest.sa 1
#>
#>
#> Final
#> Last values
#> series sa trend seas irr
#> Sep 2016 1393.5 1557.498 1559.704 -163.997649 -2.20658744
#> Oct 2016 1497.4 1553.718 1557.296 -56.318379 -3.57749836
#> Nov 2016 1684.3 1538.837 1555.164 145.462939 -16.32645755
#> Dec 2016 2850.4 1544.533 1553.556 1305.866600 -9.02221292
#> Jan 2017 1428.5 1540.203 1552.499 -111.703036 -12.29569819
#> Feb 2017 1092.4 1547.827 1551.890 -455.426856 -4.06311664
#> Mar 2017 1370.3 1535.240 1551.720 -164.939565 -16.48081320
#> Apr 2017 1522.6 1581.396 1551.632 -58.795692 29.76367672
#> May 2017 1452.4 1552.527 1551.001 -100.127238 1.52621793
#> Jun 2017 1557.2 1549.996 1549.968 7.204385 0.02775996
#> Jul 2017 1445.5 1543.239 1548.979 -97.739206 -5.73936138
#> Aug 2017 1303.1 1544.526 1548.167 -241.425886 -3.64143843