Description Usage Arguments Value Examples
View source: R/maple_fit_model.R
Fit a single forecasting model.
1 | maple_fit_model(model, deaths, population, forecast.horizon, num.threads)
|
model |
A forecasting model; see ?maple_models for more details. |
deaths |
Deaths matrix; see ?maple for more details. |
population |
Population matrix; see ?maple for more details. |
forecast.horizon |
The number of years to produce projections for. |
num.threads |
The number of threads passed to INLA; see ?maple for more details. |
If the model is fitted using INLA, an INLA object. See ?INLA::inla for more details. For Lee Carter models, a list is returned with the following entries
The logarithm of the fitted death rates.
The fitted death rates.
The intercepts.
The age-specific components in the Lee Carter model. This is a matrix whose columns correspond to age groups and rows to principal components.
The time-varying components in the Lee Carter model. This is a matrix whose columns correspond to years and rows to principal components.
A list of length equal to the number of principal components. Each item in the list is the random walk fitted as an Arima object; see ?stats::arima for more details.
The extrapolated values of gammas.fit used for projections.
The proportion of variance explained by the principal component decomposition.
The number of principal components used.
The number of years forecast ahead.
1 2 | maple_fit_model(maple_models()[[1]], deaths = maple.deaths,
population = maple.population, forecast.horizon = 20)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.