Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forecasting with NNETAR fit leads to "! I can't use NNETAR to forecast..." #422

Open
fernando-pierucci-alves opened this issue Jan 12, 2025 · 0 comments

Comments

@fernando-pierucci-alves

I am getting this error that is identical to the error in this issue:
#326

I am able to fit this model as follows:

fit <- train |>
model(NNETAR(var1 ~ lag(var2, n = 1L) + lag(var3, n = 1L)))

However, use of that fit in fc and in a plot with this code will result in the error:

fit |>
forecast(new_data = test) |>
autoplot(train) +
autolayer(test3, close, colour = "orange")

A paste of what appears to be the critical part of the backtrace:

  1. │ └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
  2. │ └─mask$eval_all_mutate(quo)
  3. │ └─dplyr (local) eval()
  4. ├─fable (local) sim_nnetar(.innov)
  5. │ └─rlang::abort("I can't use NNETAR to forecast with missing values near the end of the series.")
  6. │ └─rlang:::signal_abort(cnd, .file)
  7. │ └─base::signalCondition(cnd)
  8. └─dplyr (local) <fn>(<rlng_rrr>)

Finally, if TSLM() is used to fit that same model and with the same data, all works fine. And there is no missing values anywhere. 'Test' is 90 rows long.

Also, I am not sure if using lag() as above is best way to have NNETAR employ the variables from previous day.

Thanks in advance for assisting with this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant