Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.
Consider here the Lee Carter model, obtained on the periods 1816-1950 (in black below), 1816-1975 (in red) and 1816-2000 (in blue), unfortunately, it is difficult to compare
T=1980 base0=data.frame(D,E,A,Y,a=as.factor(A), y=as.factor(Y)) base=base0[base0$Y<=T,] LC2=gnm(D~a+Mult(a,y),offset=log(E),family= poisson,data=base) A=LC2$coefficients[1]+LC2$coefficients[2:110] B=LC2$coefficients[111:220] K0=LC2$coefficients[221:length(LC2$coefficients)] Y=as.numeric(K0) K1=c(K0,forecast(ets(Y,model="AAN"),h=240)$mean) K2=c(K0,forecast(auto.arima(Y,allowdrift=TRUE),h=240)$mean) MU=matrix(NA,length(A),length(K1)) MU1=MU2=MU for(i in 1:length(A)){ for(j in 1:length(K1)){ MU1[i,j]=exp(A[i]+B[i]*K1[j]) MU2[i,j]=exp(A[i]+B[i]*K2[j]) }} x=40 s=seq(0,109-x-1) t=2000 Pxt1=cumprod(exp(-diag(MU1[x+1+s,t+s-base1$Year[1]-1]))) Pxt2=cumprod(exp(-diag(MU2[x+1+s,t+s-base1$Year[1]-1]))) r=.035 m=70 h=seq(0,39) V1=1/(1+r)^(m-x+h)*Pxt1[m-x+h] V2=1/(1+r)^(m-x+h)*Pxt2[m-x+h] M=cbind(V1,V2) apply(M,2,sum)
Actually, it is not that bad…. even if it is only a qualitative intuition. Again, I am not a demographer, and my interest is more on actuarial science… so if we look at the estimation of annuities (still the same insurance contract, as here) for some insured of age 40 in 2000, we get the following graph (where forecasts
K1=c(K0,forecast(ets(Y[(length(Y)-50):length(Y)], model="AAN"),h=240)$mean) K2=c(K0,forecast(auto.arima(Y[(length(Y)-50):length(Y)], allowdrift=TRUE),h=240)$mean)we obtain the following graph for the annuity associated to an insurance contract sold in 2000,
R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.