Closed AQLT closed 7 months ago
There is an error in seasonal Kruskal-Wallis test on linearised series exported by RJDemetra : it is not computed on the differentiated series.
RJDemetra
y <- RJDemetra::ipi_c_eu[,"FR"] mod <- RJDemetra::jx13(y) y_lin <- RJDemetra::get_indicators( mod, "preprocessing.model.y_lin")[[1]] seas_tests <- RJDemetra::get_indicators( mod, c("diagnostics.seas-lin-qs", "diagnostics.seas-lin-kw", "diagnostics.seas-lin-friedman")) seas_tests$`diagnostics.seas-lin-qs` #> [1] 685.5168 0.0000 #> attr(,"description") #> [1] "Chi2 with 2 degrees of freedom " rjd3toolkit::seasonality_qs(rjd3toolkit::differences(y_lin, lags = 1)) #> Value: 685.5168 #> P-Value: 0.0000 rjd3toolkit::seasonality_qs(y_lin) #> Value: 713.2462 #> P-Value: 0.0000 seas_tests$`diagnostics.seas-lin-friedman` #> [1] 298.3385 0.0000 #> attr(,"description") #> [1] "Chi2 with 11 degrees of freedom " rjd3toolkit::seasonality_friedman(rjd3toolkit::differences(y_lin, lags = 1)) #> Value: 298.3385 #> P-Value: 0.0000 rjd3toolkit::seasonality_friedman(y_lin) #> Value: 302.2953 #> P-Value: 0.0000 seas_tests$`diagnostics.seas-lin-kw` #> [1] 157.9391 0.0000 #> attr(,"description") #> [1] "Chi2 with 11 degrees of freedom " rjd3toolkit::seasonality_kruskalwallis(rjd3toolkit::differences(y_lin, lags = 1)) #> Value: 331.9686 #> P-Value: 0.0000 rjd3toolkit::seasonality_kruskalwallis(y_lin) #> Value: 157.9391 #> P-Value: 0.0000
It must be the same for the test on the SA series. I think the code should be modified here : https://github.com/nbbrd/jdemetra-sa-advanced/blob/bb6b62bda313dd3a0132fa4e0bf0bab771b55215/jdr/src/main/java/ec/tstoolkit/jdr/sa/SaDiagnostics.java#L609-L612 https://github.com/nbbrd/jdemetra-sa-advanced/blob/bb6b62bda313dd3a0132fa4e0bf0bab771b55215/jdr/src/main/java/ec/tstoolkit/jdr/sa/SaDiagnostics.java#L862-L865 What do you think @palatej ?
There is an error in seasonal Kruskal-Wallis test on linearised series exported by
RJDemetra
: it is not computed on the differentiated series.It must be the same for the test on the SA series. I think the code should be modified here : https://github.com/nbbrd/jdemetra-sa-advanced/blob/bb6b62bda313dd3a0132fa4e0bf0bab771b55215/jdr/src/main/java/ec/tstoolkit/jdr/sa/SaDiagnostics.java#L609-L612 https://github.com/nbbrd/jdemetra-sa-advanced/blob/bb6b62bda313dd3a0132fa4e0bf0bab771b55215/jdr/src/main/java/ec/tstoolkit/jdr/sa/SaDiagnostics.java#L862-L865 What do you think @palatej ?