cbd_stan {StanMoMo} | R Documentation |
Bayesian Cairns-Blake-Dowd (CBD) model with Stan
Description
Fit and Forecast Bayesian CBD model. 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
cbd_stan(
death,
exposure,
age,
forecast,
validation = 0,
family = c("poisson", "nb"),
...
)
Arguments
death |
Matrix of deaths. |
exposure |
Matrix of exposures. |
age |
Vector of ages. |
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 CBD model:
or
with
where is the average age in the data.
For the period terms, we consider a multivariate random walk with drift:
with normal priors: .
The variance-covariance matrix of the error term is defined by
where the variance coefficients have independent exponential priors:
and the correlation parameter has a uniform prior:
.
As for the other models, the overdispersion parameter has a prior distribution given by
Value
An object of class stanfit
returned by rstan::sampling
References
Cairns, A. J. G., Blake, D., & Dowd, K. (2006). A Two-Factor Model for Stochastic Mortality with Parameter Uncertainty: Theory and Calibration. Journal of Risk and Insurance, 73(4), 687-718.
Examples
#10-year forecasts for French data for ages 50-90 and years 1970-2017 with a log-NB model
ages.fit<-50:90
years.fit<-1970:2017
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
fitCBD=cbd_stan(death = deathFR,exposure=exposureFR, age=ages.fit, forecast = 10,
family = "poisson",iter=iterations,chains=1)