GompertzMakeham: Gompertz-Makeham's model mortality for u(x) and its fitting
Description
Implementing Gompertz-Makeham's model mortality function of the force of mortality u(x) with conversion into qx and fitting the model to actual qx of given lifetable.
GompertzMakeham() returns model qx for the same length with t, where u(x) is internally converted into qx.
fitGM() returns the numeric vector of fitted parameters of A, B and C, RMSE for those values, and the flag of convergence.
Arguments
A
The parameter A of the Gompertz-Makeham model u(t)=A*exp(B*t)+C.
B
The parameter B of the Gompertz-Makeham model u(t)=A*exp(B*t)+C.
C
The parameter C of the Gompertz-Makeham model u(t)=A*exp(B*t)+C.
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, which is to be minimized in optim() function: 1 qx, 2 dx, otherwise lx. Default is 1.
Method
The method to be used in optim() function. Default is "Nelder-Mead".