if (FALSE) {
#assumes SOA example life table to be load
data(soaLt)
soa08Act=with(soaLt, new("actuarialtable",interest=0.06, x=x,lx=Ix,name="SOA2008"))
out<-rLifeContingencies(n=1000, lifecontingency="Axn",object=soa08Act, x=40,
t=getOmega(soa08Act)-40, m=0)
APV=Axn(soa08Act,x=40)
#check if out distribution is unbiased
t.test(x=out, mu=APV)$p.value>0.05
}
if (FALSE) {
data(soa08Act)
n=10000
lifecontingency="Axyz"
tablesList=list(soa08Act,soa08Act)
x=c(60,60); i=0.06; m=0; status="joint"; t=30; k=1
APV=Axyzn(tablesList=tablesList,x=x,n=t,m=m,k=k,status=status,type="EV")
samples<-rLifeContingenciesXyz(n=n,lifecontingency = lifecontingency,tablesList = tablesList,
x=x,t=t,m=m,k=k,status=status, parallel=FALSE)
APV
mean(samples)
}
Run the code above in your browser using DataLab