Learn R Programming

fable (version 0.3.2)

refit.NNETAR: Refit a NNETAR model

Description

Applies a fitted NNETAR model to a new dataset.

Usage

# S3 method for NNETAR
refit(object, new_data, specials = NULL, reestimate = FALSE, ...)

Value

A refitted model.

Arguments

object

The time series model used to produce the forecasts

new_data

A tsibble containing future information used to forecast.

specials

(passed by fabletools::forecast.mdl_df()).

reestimate

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.

...

Additional arguments for forecast model methods.

Examples

Run this code
lung_deaths_male <- as_tsibble(mdeaths)
lung_deaths_female <- as_tsibble(fdeaths)

fit <- lung_deaths_male %>%
  model(NNETAR(value))

report(fit)

fit %>%
  refit(new_data = lung_deaths_female, reestimate = FALSE) %>%
  report()

Run the code above in your browser using DataLab