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 |
Numeric vector of cash flows. Must be coherent with |
timeIds |
Numeric vector of time points where |
interestRates |
A single numeric interest rate or a numeric vector of the same
length as |
probabilities |
Optional numeric vector of occurrence probabilities. If missing, a vector of ones (certainty) is assumed. |
power |
Numeric power applied to discount and cash flows. Defaults to 1. |
Present value of a series of cash flows.
Evaluate the present value (or actuarial present value when probabilities are provided) of a vector of cash flows occurring at given time instants and discounted by provided interest rates.
probabilities is optional; when omitted a sequence of 1's with the
same length as timeIds is assumed. Interest rate may be a fixed number
or a vector of the same size as timeIds. The power parameter is
normally unused except in specialised actuarial evaluations.
A numeric scalar representing the present value of the cash flow vector,
or the actuarial present value if probabilities are provided.
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.
# simple example
cf <- c(10,10,10) # $10 payments one per year for three years
t <- c(1,2,3) # years
p <- c(1,1,1) # payments certainty
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.