mapa Multiple Aggregation Prediction Algorithm (Wrapper)
I want to use the mapa function in the MAPA package, everything works, and I mean everything, it does produces forecasts if I leave type empty.
But using:
type = 'es'
Produces an error, I don't know why since the documentation says that:
<<type What type of exponential smoothing implementation to use. "es" = use from the smooth package; "ets" = use from the forecast package. Default is "es" >>
https://cran.r-project.org/web/packages/MAPA/MAPA.pdf
Using type = 'ets' works fine, or just dont adding that parameter. I wanted to use xreg, but can't since it forces type type = 'es', thus producing the error.
> mapa(ts(c(1:80), frequency = 1), type = 'ets', outplot = 1)
MAPA fit MSE: 0.02, MAE: 0.13
Out-of-samplpe forecasts:
[1] 81.125
This is the error
> mapa(ts(c(1:80), frequency = 1), type = 'es', outplot = 1)
Error in !silent : invalid argument type
I have already re installed both MAPA and smooth packages.
devtools::install_github("config-i1/smooth")
devtools::install_github("trnnick/mapa")
This appears to be a bug.
mapa::mapa
calls(https://github.com/trnnick/mapa/blob/master/R/mapa.estim.R#L304)
So far fine, but if we look at
smooth/R/es.R
, we see that the function declaration isNotice that it is actually
es_old
? In commit 2d28169, the message readsIf we look for the new "real"
es()
function declaration, we find it insmooth/R/es-adam.R
, and notice thatsilent=
has changed from the string option of above to classlogical
.(https://github.com/config-i1/smooth/blob/master/R/adam-es.R#L232)
Looking around
smooth
some more it is usingsilent
as is if were logical (e.g., https://github.com/config-i1/smooth/blob/master/R/es.R#L700), so it appears that that package is consistent internally.So it appears that the bug is solely in
MAPA
in that they have not adapted to the new argument syntax. (Though part of me wants to throw some blame onsmooth
for changing a not-obscure argument fromcharacter
tological
... I can imagine other ways to more gracefully deal with such a large change in the API. If I were maintainingMAPA
, I'd add some logic so that revdep-tests at CRAN would have caught this problem.)