View source: R/4_financialFunctions.R
presentValue | R Documentation |
This function evaluates the present values of a series of cash flows, given occurrence time. Probabilities of occurrence can also be taken into account.
presentValue(cashFlows, timeIds, interestRates, probabilities,power=1)
cashFlows |
Vector of cashFlow, must be coherent with |
timeIds |
Vector of points of time where |
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 |
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.
A numeric value representing the present value of cashFlows vector, or the actuarial present value if probabilities are provided.
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.
This simple function is the kernel working core of the package. Actuarial and financial mathematics ground on it.
Giorgio A. Spedicato
Broverman, S.A., Mathematics of Investment and Credit (Fourth Edition), 2008, ACTEX Publications.
annuity
, axn
#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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.