rh_stan {StanMoMo} | R Documentation |
Bayesian Renshaw-Haberman model with Stan
Description
Fit and Forecast Bayesian Renshaw-Haberman model (Lee-Carter with cohort effect) introduced in Renshaw and Haberman (2006). The model can be fitted with a Poisson or Negative-Binomial distribution. The function outputs posteriors distributions for each parameter, predicted death rates and log-likelihoods.
Usage
rh_stan(
death,
exposure,
forecast,
validation = 0,
family = c("poisson", "nb"),
...
)
Arguments
death |
Matrix of deaths. |
exposure |
Matrix of exposures. |
forecast |
Number of years to forecast. |
validation |
Number of years for validation. |
family |
specifies the random component of the mortality model. |
... |
Arguments passed to |
Details
The created model is either a log-Poisson or a log-Negative-Binomial version of the Renshaw-Haberman model:
or
with
To ensure the identifiability of th model, we impose
where represents the most recent cohort in the data.
For the priors, the model chooses wide priors:
For the period term, we consider the standard random walk with drift:
with .
For the cohort term, we consider a second order autoregressive process (AR(2)):
To close the model specification, we impose some vague priors assumptions on the hyperparameters:
Value
An object of class stanfit
returned by rstan::sampling
.
References
Renshaw, A. E., & Haberman, S. (2006). A cohort-based extension to the Lee-Carter model for mortality reduction factors. Insurance: Mathematics and Economics, 38(3), 556-570.
Examples
#10-year forecasts for French data for ages 50-90 and years 1970-2017 with a log-Poisson model
ages.fit<-70:90
years.fit<-1990:2010
deathFR<-FRMaleData$Dxt[formatC(ages.fit),formatC(years.fit)]
exposureFR<-FRMaleData$Ext[formatC(ages.fit),formatC(years.fit)]
iterations<-50 # Toy example, consider at least 2000 iterations
fitRH=rh_stan(death = deathFR,exposure=exposureFR, forecast = 5, family = "poisson",
iter=iterations,chains=1)