Learn R Programming

fable (version 0.4.0)

refit.ARIMA: Refit an ARIMA model

Description

Applies a fitted ARIMA model to a new dataset.

Usage

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

Value

A refitted model.

Arguments

object

A model for which forecasts are required.

new_data

A tsibble containing the time points and exogenous regressors to produce forecasts for.

specials

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

reestimate

If TRUE, the coefficients for the fitted model will be re-estimated to suit the new data.

...

Other arguments passed to methods

Examples

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

fit <- lung_deaths_male %>%
  model(ARIMA(value ~ 1 + pdq(2, 0, 0) + PDQ(2, 1, 0)))

report(fit)

fit %>%
  refit(lung_deaths_female) %>%
  report()

Run the code above in your browser using DataLab