View source: R/project_parameters.R
project_parameters | R Documentation |
This function estimates the parameters in the time series specifications for the time dependent parameters in the calibrated Li-Lee model, namely \mjeqnK_tASCII representation and \mjeqn\kappa_tASCII representation, jointly for males and females.
project_parameters(fit_M, fit_F, n_ahead, n_sim, arima_spec, est_method)
fit_M |
The calibrated Li-Lee model for males. |
fit_F |
The calibrated Li-Lee model for females. |
n_ahead |
The number of years to project in the future. |
n_sim |
The number of simulations/projections. |
arima_spec |
The ARIMA time series specifications for \mjeqn(K_t^M, \kappa_t^M, K_t^F, \kappa_t^F)ASCII representation. |
est_method |
The estimation method of the parameters in the time series specifications. |
The arguments fit_M
and fit_F
are the outputs of the function
fit_li_lee
.
The argument arima_spec
is a list specifying the type of time series used
for each time dependent parameter in the Li-Lee model and is of the form:
list("K.t_M" = , "k.t_M" = , "K.t_F" = , "k.t_F" = ).
The capital K.t
refers to the time dependent parameter in the Lee-Carter model
for the common trend, i.e. \mjeqnK_tASCII representation. The small k.t
refers
to the time dependent parameter \mjeqn\kappa_tASCII representation
in the Lee-Carter model for the country-specific deviation from the common trend.
We jointly model the time series dynamics for men and women by assuming a
multivariate Gaussian distribution with mean \mjeqn(0,0,0,0)ASCII represenation and covariance matrix
\mjeqnCASCII represenation for the error terms
\mjeqn(\epsilon_t^M, \delta_t^M, \epsilon_t^F, \delta_t^F)ASCII representation
of the multivariate time series \mjeqn(K_t^M, \kappa_t^M, K_t^F, \kappa_t^F)ASCII representation.
Possible choices for the time series dynamics are RWD
(e.g. for \mjeqnK_tASCII representation)
or ARk.j
, where k
refers to an AR(k) process, an auto-regressive process
with lag k
. Further \mjeqnj \in {0,1}ASCII representation and refers
to an AR process without or with an intercept respectively.
The argument est_method
specifies the estimation method of the parameters in
the time series specifications, given in arima_spec
. A first option is SUR
,
referring to seemingly unrelated regression, that uses the function systemfit
.
This method only works for a limited amount of cases. In particular, all time series
must jointly start at the same time t. For example, this means that in the example below,
we start the joint time series estimation at year 1975 (since an AR5.0
is used).
A second option is PORT
. This is a self-written objective function that
maximizes the log-likelihood of the multivariate Gaussian distribution for
\mjeqn(\epsilon_t^M, \delta_t^M, \epsilon_t^F, \delta_t^F)ASCII represenation using the function
nlminb
in the stats
-package. In the example below, the joint estimation
consists of three parts. For t = 1971-1972 only the RWD
processes are considered leading to
a bi-variate normal log-likelihood. Then for t = 1973-1974 the two RWD
processes together with
k.t_M
are used, leading to a 3-variate normal log-likelihood. From 1975 on, we deal with the
four processes (4-variate normal log-likelihood). The sum of these three likelihoods is maximized
at once using PORT routines.
A list containing the following objects
The estimated parameters in the time series for \mjeqnK_t^MASCII representation: $coef_KtM
The estimated parameters in the time series for \mjeqn\kappa_t^MASCII representation: $coef_ktM
The estimated parameters in the time series for \mjeqnK_t^FASCII representation: $coef_KtF
The estimatedparameters in the time series for \mjeqn\kappa_t^FASCII representation: $coef_ktF
The estimated covariance matrix \mjeqnCASCII representation: $cov_mat
The \mjeqnK_t^MASCII representation simulations: $K.t_M
The \mjeqn\kappa_t^MASCII representation simulations: $k.t_M
The \mjeqnK_t^FASCII representation simulations: $K.t_F
The \mjeqn\kappa_t^FASCII representation simulations: $k.t_F
lst <- MultiMoMo::european_mortality_data dat_M <- lst$M dat_F <- lst$F xv <- 0:90 yv = yvSPEC <- 1970:2018 Countries <- names(dat_M$UNI) CountrySPEC <- "BE" fit_M <- fit_li_lee(xv, yv, yvSPEC, CountrySPEC, dat_M, "NR", TRUE, FALSE) fit_F <- fit_li_lee(xv, yv, yvSPEC, CountrySPEC, dat_F, "NR", TRUE, FALSE) arima_spec <- list(K.t_M = "RWD", k.t_M = "AR3.1", K.t_F = "RWD", k.t_F = "AR5.0") n_ahead <- 50 n_sim <- 10000 est_method <- "PORT" proj <- project_parameters(fit_M, fit_F, n_ahead, n_sim, arima_spec, est_method)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.