generate.mdl_vtl_df {vital}R Documentation

Generate responses from a mable

Description

Use a fitted model to simulate future data with similar behaviour to the response.

Usage

## S3 method for class 'mdl_vtl_df'
generate(x, new_data = NULL, h = NULL, bootstrap = FALSE, times = 1, ...)

Arguments

x

A mable.

new_data

Future data needed for generation (should include the time index and exogenous regressors)

h

The simulation horizon (can be used instead of new_data for regular time series with no exogenous regressors).

bootstrap

If TRUE, then forecast distributions are computed using simulation with resampled errors.

times

The number of replications.

...

Additional arguments

Details

Innovations are sampled by the model's assumed error distribution. If bootstrap is TRUE, innovations will be sampled from the model's residuals.

Value

A vital object with simulated values.

Author(s)

Rob J Hyndman and Mitchell O'Hara-Wild

Examples

aus_mortality |>
  dplyr::filter(State == "Victoria") |>
  model(lc = LC(Mortality)) |>
  generate(times = 3, bootstrap = TRUE)


[Package vital version 1.1.0 Index]