cf.analysis: Cash Flow Analysis

Description Usage Arguments Details Value Note See Also Examples

Description

Calculates the present value, macaulay duration and convexity, and modified duration and convexity for given cash flows. It also plots the convexity and time diagram of the cash flows.

Usage

1
cf.analysis(cf,times,i,plot=FALSE,time.d=FALSE)

Arguments

cf

vector of cash flows

times

vector of the periods for each cash flow

i

interest rate per period

plot

tells whether or not to plot the convexity

time.d

tells whether or not to plot the time diagram of the cash flows

Details

pv=∑_{k=1}^n\frac{cf_k}{(1+i)^{times_k}}

MAC D=\frac{∑_{k=1}^n times_k*(1+i)^{-times_k}*cf_k}{pv}

MOD D=\frac{∑_{k=1}^n times_k*(1+i)^{-(times_k+1)}*cf_k}{pv}

MAC C=\frac{∑_{k=1}^n {times_k}^2*(1+i)^{-times_k}*cf_k}{pv}

MOD C=\frac{∑_{k=1}^n times_k*(times_k+1)*(1+i)^{-(times_k+2)}*cf_k}{pv}

Value

A matrix of all of the calculated values.

Note

The periods in t must be positive integers.

See Also

TVM

Examples

1
2
3
cf.analysis(cf=c(1,1,101),times=c(1,2,3),i=.04,time.d=TRUE)

cf.analysis(cf=c(5,1,5,45,5),times=c(5,4,6,7,5),i=.06,plot=TRUE)

FinancialMath documentation built on May 1, 2019, 11:16 p.m.