rjdverse / rjd3x13

R access to X13-Arima algorithm in JDemetra+ version 3.x
https://rjdverse.github.io/rjd3x13/
European Union Public License 1.2
4 stars 8 forks source link

goal of x13_dictionary()? #37

Closed AQLT closed 5 months ago

AQLT commented 7 months ago

In #26 it is said that we shouldn't look the differences between rjd3x13::x13_dictionary() and rjd3toolkit::dictionary(), but then what is the goal of the function rjd3x13::x13_dictionary()? Indeed several outputs are not exportable with the x13 function:

mod <- rjd3x13::x13(rjd3toolkit::ABS$X0.2.09.10.M,
           userdefined = c("regression.td-derived", "regression.td-ftest", "regression.details.description", 
                        "regression.details.type", "mode", 
                        "seasonal", "i_f", "decomposition.d10a", "decomposition.d11a", 
                        "decomposition.d12a", "decomposition.icratio"))
c(mod$user_defined)
#> $`regression.td-derived`
#> NULL
#> 
#> $`regression.td-ftest`
#> NULL
#> 
#> $regression.details.description
#> NULL
#> 
#> $regression.details.type
#> NULL
#> 
#> $mode
#> NULL
#> 
#> $seasonal
#> NULL
#> 
#> $i_f
#> NULL
#> 
#> $decomposition.d10a
#> NULL
#> 
#> $decomposition.d11a
#> NULL
#> 
#> $decomposition.d12a
#> NULL
#> 
#> $decomposition.icratio
#> NULL

And some output are not mentioned but seem exportable (like the forecasts of the calendar component or the relative contribution of the components to the stationary portion of the variance):

mod <- rjd3x13::x13(rjd3toolkit::ABS$X0.2.09.10.M,
                    userdefined = c("cal_f","variancedecomposition.cycle", "variancedecomposition.irregular", 
                                    "variancedecomposition.others", "variancedecomposition.seasonality", 
                                    "variancedecomposition.tdh", "variancedecomposition.total"))
c(mod$user_defined)
#> $cal_f
#>            Jan       Feb       Mar       Apr       May       Jun       Jul
#> 2017                                                                      
#> 2018 1.0069944 0.9911504 1.0314662 0.9649992 1.0069944 0.9965211 0.9988390
#>            Aug       Sep       Oct       Nov       Dec
#> 2017           0.9965211 0.9988390 1.0046575 0.9907497
#> 2018 1.0069944                                        
#> 
#> $variancedecomposition.cycle
#> [1] 0.132838
#> 
#> $variancedecomposition.irregular
#> [1] 0.00752459
#> 
#> $variancedecomposition.others
#> [1] 0.002947478
#> 
#> $variancedecomposition.seasonality
#> [1] 0.8694796
#> 
#> $variancedecomposition.tdh
#> [1] 0.002449509
#> 
#> $variancedecomposition.total
#> [1] 1.015239

Maybe the results of rjd3x13::x13_dictionary() refer to something else than the dictionary of the exportable variables of the R function x13?

palatej commented 5 months ago

As discussed elsewhere, the x13_dictionary() contains all the stable and documented output. It should be a subset of dictionary(). Not completely the case. To be completed. Normal users should use x13_dictionary()

AQLT commented 5 months ago

Yes but currently x13_dictionary() is not a subset of dictionary(), should I then open a new issue? All the output bellow aren't in dictionary() and are not exportable

mod_dic <- rjd3toolkit::dictionary(rjd3x13::jx13(rjd3toolkit::ABS$X0.2.09.10.M))
setdiff(rjd3x13::x13_dictionary(), mod_dic)
#>  [1] "regression.td-derived"          "regression.td-ftest"           
#>  [3] "regression.details.description" "regression.details.type"       
#>  [5] "reg"                            "reg_f(?)"                      
#>  [7] "reg_b(?)"                       "mode"                          
#>  [9] "seasonal"                       "i_f"                           
#> [11] "decomposition.d10a"             "decomposition.d11a"            
#> [13] "decomposition.d12a"             "decomposition.icratio"
palatej commented 5 months ago

The issue should be in the Java libraries, not in the R package. I will put it there