R/model_nnetar.R

Defines functions .nnetar_forecast .nnetar_fit

.nnetar_fit <- function(train_df, date_agg = "day", ...) {
  forecast::nnetar(.prep_train_ts(train_df, date_agg))
}
# forecast.nnetar() doesn't compute prediction intervals unless PI = TRUE
# is passed (they require bootstrap simulation and are comparatively
# expensive) -- left off by default for responsiveness, so .to_tibble()
# simply has no yhat_lower/yhat_upper for this model, which
# plot_forecast_generic() already handles gracefully.
.nnetar_forecast <- function(model, h, ...) forecast::forecast(model, h = h)

Try the forecastsuite package in your browser

Any scripts or data that you put into this service are public.

forecastsuite documentation built on Oct. 18, 2026, 5:08 p.m.