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
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