R: Function to generate samples from the life contingencies...
rLifeContingencies
R Documentation
Function to generate samples from the life contingencies stochastic variables.
Description
This function returns a n-size sample from the underlying present value of benefits
stochastic variable defined by a specific life contingencies insurance form.
Usage
rLifeContingencies(n, lifecontingency, object, x, t,
i = object@interest, m=0, k = 1 , parallel=FALSE, payment="advance")
Arguments
n
Size of sample
lifecontingency
A character string, either "Exn" or "Axn" or "axn" or "IAxn" or "DAxn".
object
An actuarialtable object.
x
Policyholder's age at issue time.
t
The lenght of the insurance. Must be specified according to the present
value of benefits definition.
i
The interest rate, whose default value is the actuarialtable interest rate slot value.
m
Deferring period, default value is zero.
k
Fractional payment, default value is 1.
parallel
Uses the parallel computation facility.
payment
Payment type: "advance" default is the annuity due, otherwise annuity due.
Details
This function is a wrapper for internal function that returns the present value of insured
benefits.
Value
A numeric vector.
Warning
Before using this function, the unbiaseness of the sample drawn from the distribution shall be verified. The function is still in testing ad for some classes of life contingencies biased.
The function is provided as is, without any warranty regarding the accuracy of calculations. The author disclaims any liability for eventual
losses arising from direct or indirect use of this software. Currently k>1 computation are not supported yet.
Note
This function is a wrapper for many internal functions. It is called by all actuarial mathematics functions when value "ST" is provided to
type parameter.
Author(s)
Giorgio Alfredo Spedicato.
References
Actuarial Mathematics (Second Edition), 1997, by Bowers, N.L., Gerber, H.U., Hickman, J.C.,
Jones, D.A. and Nesbitt, C.J.
See Also
Exn, Axn, axn,IAxn,DAxn.
Examples
#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, i=soa08Act@interest,m=0)
APV=Axn(soa08Act,x=40)
#check if out distribution is unbiased
t.test(x=out, mu=APV)$p.value>0.05