<< cfr Financial module esvarevt >>

Financial module >> Financial module > duration

duration

given a set of cash flows (either positive of negative) from an investment and the dates at which they are available, the function computes: the duration of the cash flows, the convexity of the cash flows, and the yield-to-maturity "ytm" (both duration and convexity are computed by taking ytm as the discount rate)

SYNOPSIS

[dur,con,ytm]=duration(t,c);

Description

On cash flows available at given dates, duration, convexity and yield to maturity are computed

Parameters

t
column vector of dates at which cash flows are available: the first element must be zero; time unit of measure is generally the year
c
column vector containing the cash flows; the first element must be the cost of the investment (and it must be a negative number)

Output

dur
duration (weighted time to maturity) of the cash flows; this output has the same time unit of measure of the input "t"
con
convexity (weighted square time to maturity) of the cash flows; this output has the same time unit of measure of the input "t"
ytm
yield to maturity (i.e. internal rate of return) of the cash flows; this output has the same time unit of measure of the input "t"; this value is computed with the fsolve function; if the convergence of the algorithm is not good, a message is shown

Example

A bond, whose value on the market is 101.5, pays a cash flow of 2.5 euros any six month (i.e. 1/2 year) and for the next 2 years. At maturity it pays also its face value of 100 euros. Let us compute duration, convexity, and yield-to-maturity.

At first we define the vector of dates and cash flows

-->t=[0 0.5 1 1.5 2]';

-->c=[-101.5 2.5 2.5 2.5 102.5]';

-->[D,C,Y]=duration(t,c)

Y = 0.0425443

C = 3.7981714

D = 1.9286213

Authors

Francesco Menoncin - Brescia University - 2010

See Also


<< cfr Financial module esvarevt >>