Mcompetitions / M5-methods

Data, Benchmarks, and methods submitted to the M5 forecasting competition
573 stars 232 forks source link

iMAPA does not return forecast #1

Closed sriharitn closed 4 years ago

sriharitn commented 4 years ago

iMAPA does not return forecast. Should we add return function at the end of iMAPA function ?

iMAPA <- function(x, h){
  mal <- round(mean(intervals(x)),0)
  frc <- NULL
  for (al in 1:mal){
    frc <- rbind(frc, rep(SexpS(as.numeric(na.omit(as.numeric(rollapply(tail(x, (length(x) %/% al)*al), al, FUN=sum, by = al)))), 1)/al, h))
  }
  forecast <- colMeans(frc)
  return(forecast)

}
Mcompetitions commented 4 years ago

Thanks for mentioning this. Just updated the code.