Learn R Programming

lifecontingencies (version 0.0.3)

presentValue: Present value of a series of cash flows.

Description

This function evaluates the present values of a series of cashFlows, due at specific times, using a specific discount curve and a vector of probabilities.

Usage

presentValue(cashFlows, timeIds, interestRates, probabilities)

Arguments

cashFlows
Vector of cashFlow, must be coherent with timeIds
timeIds
Vector of points of time where cashFlows are due.
interestRates
A numeric value or a time-size vector of interest rate used to discount cahs flow.
probabilities
Optional vector of probabilities.

Value

  • A numeric value representing the present value of cashFlows vector, or the actuarial value if probabilities are provided.

Warning

The function is provided as is, without any guarantee regarding the accuracy of calculation. The author disclaims any liability for eventual losses arising from direct or indirect use of this software.

Details

probabilities is optional, a sequence of 1 length of timeIds is assumed. Interest rate shall be a fixed number or a vector of the same size of timeIds.

References

Broverman, S.A., Mathematics of Investment and Credit (Fourth Edition), 2008, ACTEX Publications.

See Also

annuity, axn

Examples

Run this code
#simple example
 cf=c(10,10,10)	#$10 of payments one per year for three years
 t=c(1,2,3) #years
 p=c(1,1,1) #assume payments certainty
 #assume 3% of interest rate
presentValue(cashFlows=cf, timeIds=t, interestRates=0.03, probabilities=p)

Run the code above in your browser using DataLab