Applies a fitted NNETAR model to a new dataset.
# S3 method for class 'NNETAR'
refit(object, new_data, specials = NULL, reestimate = FALSE, ...)
A model for which forecasts are required.
A tsibble containing the time points and exogenous regressors to produce forecasts for.
(passed by fabletools::forecast.mdl_df()
).
If TRUE
, the networks will be initialized with random
starting weights to suit the new data. If FALSE
, for every network the best
individual set of weights found in the pre-estimation process is used as the
starting weight vector.
Other arguments passed to methods
A refitted model.
lung_deaths_male <- as_tsibble(mdeaths)
lung_deaths_female <- as_tsibble(fdeaths)
fit <- lung_deaths_male %>%
model(NNETAR(value))
report(fit)
#> Series: value
#> Model: NNAR(3,1,2)[12]
#>
#> Average of 20 networks, each of which is
#> a 4-2-1 network with 13 weights
#> options were - linear output units
#>
#> sigma^2 estimated as 20182
fit %>%
refit(new_data = lung_deaths_female, reestimate = FALSE) %>%
report()
#> Series: value
#> Model: NNAR(3,1,2)[12]
#>
#> Average of 20 networks, each of which is
#> a 4-2-1 network with 13 weights
#> options were - linear output units
#>
#> sigma^2 estimated as 274013