Learn R Programming

lifecontingencies (version 0.0.3)

lifecontingencies-package: Calculates life contingencies and financial mathematics functions.

Description

The lifecontingencies package has been developed to aid actuaries to perform standard life contingencies analysis as long as standard financial mathematics calculation. Currently most important life contingencies actuarial function have been implemented. Multiple life contingencies misses.

Arguments

Warning

This package and functions herein are provided as is, without any guarantee regarding the accuracy of calculations. The author disclaims any liability arising by eventual losses due to direct or indirect use of this package.

Details

ll{ Package: lifecontingencies Type: Package Version: 0.0.2 Date: 2011-08-15 License: GPL-2.0 LazyLoad: yes }

References

Actuarial Mathematics (Second Edition), 1997, by Bowers, N.L., Gerber, H.U., Hickman, J.C., Jones, D.A. and Nesbitt, C.J. Broverman, S.A., Mathematics of Investment and Credit (Fourth Edition), 2008, ACTEX Publications.

See Also

accumulatedValue, annuity

Examples

Run this code
##calculates monthly installment of a loan of $100,000, interest rate 5.00%

intEff=(1+0.05)^(1/12)-1
Capital=100000
#Montly installment

R=Capital/annuity(interestRates=intEff, periods=10*12, type = "immediate")
R
balance=numeric(10*12+1)
capitals=numeric(10*12+1)
interests=numeric(10*12+1)
balance[1]=Capital
interests[1]=0
capitals[1]=0

for(i in (2:121))	{
			balance[i]=balance[i-1]*(1+intEff)-R
			interests[i]=balance[i-1]*intEff
			capitals[i]=R-interests[i]
			}
loanSummary=data.frame(rate=c(0, rep(R,10*12)), balance, interests, capitals)

		#assumes SOA example life table to be load

		data(soaLt)
		soa08Act=with(soaLt, new("actuarialtable",interest=0.06,
		x=x,lx=Ix,name="SOA2008"))
		#evaluate and life-long annuity for an aged 65
		axn(soa08Act, x=65)

Run the code above in your browser using DataLab