forecast.FDM | R Documentation |
The forecast function allows you to produce future predictions of a vital model, where the response is a function of age. The forecasts returned contain both point forecasts and their distribution.
## S3 method for class 'FDM'
forecast(
object,
new_data = NULL,
h = NULL,
point_forecast = list(.mean = mean),
simulate = FALSE,
bootstrap = FALSE,
times = 5000,
...
)
## S3 method for class 'LC'
forecast(
object,
new_data = NULL,
h = NULL,
point_forecast = list(.mean = mean),
simulate = FALSE,
bootstrap = FALSE,
times = 5000,
...
)
## S3 method for class 'FMEAN'
forecast(
object,
new_data = NULL,
h = NULL,
point_forecast = list(.mean = mean),
simulate = FALSE,
bootstrap = FALSE,
times = 5000,
...
)
## S3 method for class 'FNAIVE'
forecast(
object,
new_data = NULL,
h = NULL,
point_forecast = list(.mean = mean),
simulate = FALSE,
bootstrap = FALSE,
times = 5000,
...
)
## S3 method for class 'mdl_vtl_df'
forecast(
object,
new_data = NULL,
h = NULL,
point_forecast = list(.mean = mean),
simulate = FALSE,
bootstrap = FALSE,
times = 5000,
...
)
object |
A mable containing one or more models. |
new_data |
A |
h |
Number of time steps ahead to forecast. This can be used instead of |
point_forecast |
A list of functions used to compute point forecasts from the forecast distribution. |
simulate |
If |
bootstrap |
If |
times |
The number of sample paths to use in estimating the forecast distribution when |
... |
Additional arguments passed to the specific model method. |
A fable containing the following columns:
.model
: The name of the model used to obtain the forecast. Taken from
the column names of models in the provided mable.
The forecast distribution. The name of this column will be the same as the
dependent variable in the model(s). If multiple dependent variables exist,
it will be named .distribution
.
Point forecasts computed from the distribution using the functions in the
point_forecast
argument.
All columns in new_data
, excluding those whose names conflict with the
above.
Rob J Hyndman and Mitchell O'Hara-Wild
aus_mortality |>
dplyr::filter(State == "Victoria", Sex == "female") |>
model(naive = FNAIVE(Mortality)) |>
forecast(h = 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.