Subsections


The value of time

Finance as a field of study is sometimes somewhat flippantly said to deal with the value of two things: time and risk. While this is not the whole story, there is a deal of truth in it. These are the two issues which is always present. We start our discussion by ignoring risk and only considering the implications of the fact that anybody prefers to get something earlier rather than later, or the value of time.


Present value.

The calculation of present value is one of the basics of finance. The present value is the current value of a stream of future payments. Let $C_t$ be the cash flow at time $t$. Suppose we have $N$ future cash flows that occur at times $t_1, t_2, \cdots , t_N$.


\begin{picture}(240,30)
\put(0,15){\vector(1,0){240}}
\multiput(10,12.5)(30,0){8...
...ut(65,20){\small$C_2$}
\put(155,20){\small$C_N$}
\put(215,0){time}
\end{picture}

To find the present value of these future cash flows one need a set of prices of future cash flows. Suppose $P_t$ is the price one would pay today for the right to recive one dollar at a future date $t$. If one knows this set of prices one would calculate the present value as the sum of the preent values of the different elements.

\begin{displaymath}PV = \sum_{i=1}^N P_{t_i} C_{t_i} \end{displaymath}


\begin{picture}(270,130)
\put(0,115){\vector(1,0){260}}
\multiput(10,112.5)(30,0...
...75}}
\put(160,25){\vector(-1,0){120}}
\put(0,20){$P_{t_N}C_{t_N}$}
\end{picture}

However, knowing the set of prices of all future dates is not always feasible. As a first approximation we assume that there is one interest rate which is used for discounting, (this is termed a flat term structure), and the prices of future payments $P_{t}$, which is also called a discount factor, is calculated from this interest rate.

The best known example, known as discrete compounding, is calculated as

\begin{displaymath}P_t = \frac{1}{(1+r)^t}, \end{displaymath}

In this case one would calculate the present value as

\begin{displaymath}PV = \sum_{i=1}^N \frac{ C_{t_i} } { (1+r)^t } \end{displaymath}

The implementation of this calculation is shown in code 2.1


\begin{program}
% latex2html id marker 878\caption{Present value with discrete...
...file{/home/bernt/2003_algor/all_cc_tex_files/cflow_pv_discrete.cc}
\end{program}

However, such discrete compounding is not the only alternative way to approximate the discount factor. The discretely compounded case assumes that interest is added at discrete points in time (hence the name). However, an alternative assumption is to assume that interest is added continously. If compounding is continous, and $r$ is the interes rate, one would calculate the current price of reciving one dollar at a future date $t$ as

\begin{displaymath}P_t = e^{-rt}, \end{displaymath}

which implies the following present value calculation:

\begin{displaymath}PV = \sum_{i=1}^N e^{-rt_i} C_{t_i} \end{displaymath}

This calculation is implemented as shown in code 2.2. In much of what follows we will work with this continously compounded case. There is a number of reasons why, but a prime reason is actually that it is easier to use continously compounded interest than discretely compounded, because it is easier to deal with uneven time periods. Discretely compounded interest is easy to use with evenly spaced cash flows (such as annual cash flows), but harder otherwise.


\begin{program}
% latex2html id marker 883\caption{Present value calculation w...
...}
\lgrindfile{/home/bernt/2003_algor/all_cc_tex_files/cflow_pv.cc}
\end{program}


Internal rate of return.

The internal rate of return of a set of cash flows is the interest rate that makes the present value of the cash flows equal to zero. Finding an internal rate of return is thus to find a root of of the equation

\begin{displaymath}PV(C,t,r)=0 \end{displaymath}

As any textbook in basic finance, such as Brealey and Myers (1996) or Ross et al. (1996) or will tell, there is a number of problems with using the IRR, most of them stemming from the possibility for more than one interest rate being defined.

If we know that there is one IRR, the following method is probably simplest, bisection. It is an adaption of the bracketing approach discussed in Press et al. (1992), chapter 9. Note that this approach will only find one interest rate, if there is more than one irr, the simplest is always to graph the PV as a function of interest rates, and use that to understand when an investment is a good one.


\begin{program}
% latex2html id marker 888\caption{Estimation of the internal ...
...
\lgrindfile{/home/bernt/2003_algor/all_cc_tex_files/cflow_irr.cc}
\end{program}


Check for unique IRR

If you worry about finding more than one IRR, the code shown in code 2.4 implements a simple check for that. It is only a neccesary condition for a unique IRR, not sufficient, so you may still have a well-defined IRR even if this returns false.

The first test is just to count the number of sign changes in the cash flow. From Descartes rule we know that the number of real roots is one if there is only one sign change. If there is more than one change in the sign of cash flows, we can go further and check the aggregated cash flows for sign changes (See Norstrom (1972), or Berck and Sydsæter (1995)).


\begin{program}
% latex2html id marker 893\caption{Test for uniqueness of IRR}...
...{/home/bernt/2003_algor/all_cc_tex_files/cflow_irr_test_unique.cc}
\end{program}


Bonds

In this part we look at the treatment of bonds and similar fixed income securities. What distinguishes bonds is that the future payments (of coupon, principal) are decided when the security is issued. We again limit ourselves to the case of a flat term structure, and return to bond pricing with more general term structures later.


Bond Price

The price of a bond is the present value of its future cashflows. If we consider a coupon bond like a US goverment bond (T-Bond), the cash flows look like

\begin{displaymath}
\begin{array}{lcccccc}
t=& 0&1&2&3&\cdots&T\\
\textrm{Coupo...
...C&C&\cdots&C\\
\textrm{Face value} & & & & & &F\\
\end{array}\end{displaymath}

The current price of the bond is

\begin{displaymath}P_0 = \sum_{t=1}^T \frac{C}{(1 + r)^{t}} + \frac{F}{(1+r)^T} \end{displaymath}

with discrete compounding, and

\begin{displaymath}P_0 = \sum_{t=1}^T e^{-rt}C + e^{-rT}F \end{displaymath}

with continous compounding. The interest rate $r$ is fixed, which means that the term structure is ``flat.''

Let us look at two versions of the bond price algorithm for the continous case.


\begin{program}
% latex2html id marker 898\caption{Bond price}
\lgrindfile{/home/bernt/2003_algor/all_cc_tex_files/bonds_price_both.cc}
\end{program}


\begin{program}
% latex2html id marker 903\caption{Bond price}
\lgrindfile{/home/bernt/2003_algor/all_cc_tex_files/bonds_price.cc}
\end{program}

There are two version of the routine listed, one which is called with both interest and principal vectors (code 2.5) and another (code 2.6) which is simply called with the cashflows. I show both to make one think about the fact that for most purposes the distinction between coupons and principals is not necessary to make, what counts is the cashflows, which is the sum of coupons and principal. There are cases where the distinction is important, for example when taxes are involved. Then we need to keep track of what is interest and what is principal. But in the simple cases considered here I stick to the case of one set of cashflows, it makes the routines easier to follow.

Let us also look at the case of discrete (annual) compounding, shown in code 2.7.


\begin{program}
% latex2html id marker 908\caption{Bond price}
\lgrindfile{/home/bernt/2003_algor/all_cc_tex_files/bonds_price_discrete.cc}
\end{program}


Yield to maturity.

The yield to maturity is the interest rate that makes the present value of the future coupon payments equal to the current bondprice, that is, for a known price $P_0$, the yield is the solution $y$ to the equation

\begin{displaymath}P_0 = \sum_{t=1}^T e^{-yt}C + e^{-yT}F \end{displaymath}

Note that this is the same as finding the internal rate of return, if we include in the cash flows the price of the bond as a negative cash flow ``today''. The algoritm shown in code 2.8 is simple bisection, we know that the yield is above zero, and find a maximium yield which the yield is below, and then bisect the interval until we are ``close enough.''


\begin{program}
% latex2html id marker 913\caption{Bond yield}
\lgrindfile{/home/bernt/2003_algor/all_cc_tex_files/bonds_yield.cc}
\end{program}


Duration.

The duration of a bond is the ``weighted average maturity'' of the bond.


\begin{displaymath}\mbox{Duration} = \sum_t \frac{t C_tP_t}{\mbox{Bond Price}} \end{displaymath}

where There are two versions of the duration calculation, based on how one estimate the bond price. One assumes the current interest rate $r$ and calculates

\begin{displaymath}\mbox{Bond price}= \sum_{t=1}^T e^{-rt}C_t\end{displaymath}

which gives the duration calculation shown in code 2.9


\begin{program}
% latex2html id marker 918\caption{Bond duration}
\lgrindfile{/home/bernt/2003_algor/all_cc_tex_files/bonds_duration.cc}
\end{program}

Alternatively one can calculate the yield to maturity for the bond, and use that in estimating the bond price. This is called Macaulay Duration First one calculates $y$, the yield to maturity, from

\begin{displaymath}\mbox{Bond price}= \sum_{t=1}^T e^{-yt}C_t\end{displaymath}

and then use this $y$ in the duration calculation:

\begin{displaymath}\mbox{Macaulay duration} = \sum \frac{t C_te^{-yt}}{\sum e^{-yt}C_t} \end{displaymath}

Code 2.10
\begin{program}
% latex2html id marker 923\caption{Calculating the Macaulay du...
...home/bernt/2003_algor/all_cc_tex_files/bonds_duration_macaulay.cc}
\end{program}


Modified Duration


\begin{displaymath}\textrm{Modified Duration} = \frac{\textrm{duration}}{\textrm{yield}} \end{displaymath}


\begin{program}
% latex2html id marker 928\caption{Modified duration}
\lgrindf...
...home/bernt/2003_algor/all_cc_tex_files/bonds_duration_modified.cc}
\end{program}

Bond convexity

Convexity measures the curvature of the approximation done when using duration. It is calculated as

\begin{displaymath}\sum_{i=1}^nc_it_i^2e^{-yt_i}\end{displaymath}


\begin{program}
% latex2html id marker 933\caption{Bond convexity}
\lgrindfile{/home/bernt/2003_algor/all_cc_tex_files/bonds_convexity.cc}
\end{program}

2003-10-22