Function to calculate present value of annuities-certain.
Usage
annuity(interestRates, periods, type = "immediate")
Arguments
interestRates
Effective interest rate expressed in decimal form. E.g. 0.03 means 3%. It can be a vector of interest rates of the same length
of periods. If interestRate = infinity then it returns the value of a perpetuity.
periods
Number of payments.
type
A string, either "immediate" or "due".
Value
A string, either "immediate" or "due".
Details
This function calculates the present value of a stream of fixed payments separated by equal interval of time. Annuity immediate has the
fist payment at time t=0, while an annuity due has the first payment at time t=1.
References
Broverman, S.A., Mathematics of Investment and Credit (Fourth Edition),
2008, ACTEX Publications.
# The present value of 5 payments of 1000 at one year interval beginnin now when the interest rate is 2.5% is1000*annuity(interestRates=0.05, periods=5, type = "due")