Learn R Programming

fmsb (version 0.5.2)

Siler: Siler's model mortality for qx and its fitting

Description

Implementing Siler's model mortality function of qx and fitting the model to actual qx of given lifetable.

Usage

Siler(a1, b1, a2, a3, b3, t) fitSiler(initialpar=c(0.01,3,1e-4,1e-5,0.1), data, mode=1, Method="Nelder-Mead", ...)

Arguments

a1
The parameter a1 of the Siler model, q(t)=a1*exp(-b1*t)+a2+a3*exp(b3*t).
b1
The parameter b1 of the Siler model, q(t)=a1*exp(-b1*t)+a2+a3*exp(b3*t).
a2
The parameter a2 of the Siler model, q(t)=a1*exp(-b1*t)+a2+a3*exp(b3*t).
a3
The parameter a3 of the Siler model, q(t)=a1*exp(-b1*t)+a2+a3*exp(b3*t).
b3
The parameter b3 of the Siler model, q(t)=a1*exp(-b1*t)+a2+a3*exp(b3*t).
t
Age (vector OK) in years
initialpar
Initial value for the parameters to be estimated. If not given, c(0.01, 0.0003, 0.07) is used.
data
Actual vector of qx in the lifetable to be used to obtain the best-fit parameters of the Gompertz-Makeham model.
mode
Which of lifetable functions should be used to calculate the RMSE: 1 qx, 2 dx, otherwise lx. Default is 1.
Method
The method to be used in optim() function. Default is "Nelder-Mead".
...
Other options to be passed to optim().

Value

Siler() returns model qx for the same length with t. fitSiler() returns the numeric vector of fitted parameters a1, b1, a2, a3 and b3, RMSE for those values, and the flag of convergence.

See Also

Jlife

Examples

Run this code
 res <- fitSiler(,Jlife$qx2005M)
 FLAG <- res[7]
 while (FLAG>0) {
   res <- fitSiler(res[1:5], Jlife$qx2005M)
   FLAG <- res[7]
 }
 print(res)

Run the code above in your browser using DataLab