rjdverse / rjdemetra

R interface to JDemetra+ v 2.x
https://rjdverse.github.io/rjdemetra
52 stars 16 forks source link

fcst.horizon in x13_spec does not have any effect #143

Closed jonlachmann closed 4 months ago

jonlachmann commented 4 months ago

I just started using RJDemetra and am very impressed with most things so far. However, I tried to change the forecast horizon of the model in order to use the results for forecasting, but the fcst.horizon flag of x13_spec does not appear to have any effect.

Am I doing something wrong, or is there a bug here? I have created this minimal example to show what I mean, note how the last row will print 12 and not 36 as I expected.

library(RJDemetra)
myseries <- ipi_c_eu[, "FR"]
spec <- x13_spec(fcst.horizon = 36)
x13_model <- x13(myseries, spec = spec)
nrow(x13_model$final$forecasts)
AQLT commented 4 months ago

The parameter fct.horizon has no impact on the decomposition, you must use x11.fcasts parameter

library(RJDemetra)
myseries <- ipi_c_eu[, "FR"]
spec <- x13_spec(fcst.horizon = 46,
                 x11.fcasts = 36)
x13_model <- x13(myseries, spec = spec)
nrow(x13_model$regarima$forecast)
#> [1] 46
nrow(x13_model$final$forecasts)
#> [1] 36