# presentValue: Present value of a series of cash flows. In spedygiorgio/lifecontingencies: Financial and Actuarial Mathematics for Life Contingencies

## Description

This function evaluates the present values of a series of cash flows, given occurrence time. Probabilities of occurrence can also be taken into account.

## Usage

 `1` ```presentValue(cashFlows, timeIds, interestRates, probabilities,power=1) ```

## 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. `power` Power to square discount and cash flows. Default is set to 1

## 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`. `power` parameters is generally useless beside life contingencies insurances evaluations.

## Value

A numeric value representing the present value of cashFlows vector, or the actuarial present 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.

## Note

This simple function is the kernel working core of the package. Actuarial and financial mathematics ground on it.

## Author(s)

Giorgio A. Spedicato

## References

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

`annuity`, `axn`
 ```1 2 3 4 5 6``` ``` #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) ```