0% found this document useful (0 votes)
2 views6 pages

Notes Math Recursion

The document provides an informal introduction to recursive methods in mathematics, computer science, and their applications in economics and finance. It illustrates various examples of recursion, including linear difference equations, the Fibonacci sequence, and asset pricing models, emphasizing their significance in modern macroeconomic theory. The text also discusses how recursive methods can be used to value bonds and equity, highlighting the no-arbitrage theorem and the recursive nature of financial valuation.

Uploaded by

23hsh013
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
2 views6 pages

Notes Math Recursion

The document provides an informal introduction to recursive methods in mathematics, computer science, and their applications in economics and finance. It illustrates various examples of recursion, including linear difference equations, the Fibonacci sequence, and asset pricing models, emphasizing their significance in modern macroeconomic theory. The text also discusses how recursive methods can be used to value bonds and equity, highlighting the no-arbitrage theorem and the recursive nature of financial valuation.

Uploaded by

23hsh013
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 6

ECON-UB 233 Dave Backus @ NYU

Math Tools: Recursive Methods


Revised: November 28, 2015

The concept of recursion runs throughout modern mathematics and computer science. The
same is true of economics and finance. There’s a reason the leading PhD textbook in macroe-
conomics is called Recursive Macroeconomic Theory. Such work in economics reflects, in
large part, the adoption by economists of methods developed elsewhere.

What follows is a short informal introduction to the idea and a start on the kinds of
applications you’ll find in economics and finance.

Warning: This contains a little linear algebra. Skip it if that’s not part of your skill set.

1 Examples of recursion

The idea is to characterize a sequence of items, indexed by an integer n = 0, 1, 2, . . ., by a


rule that connects each item to the next one. If we label the items xn , the rule might be
expressed

xn+1 = g(xn ). (1)

If we have a starting point, say x0 , the rule tells us how to compute as many succeeding
items as we wish. We would say that the set {xn } is generated recursively and refer to (1)
as the defining recurrence relation. A “solution” to (1) is a formula that expresses xn as a
function of n.

Examples:

1. Linear difference equation. Let

xn+1 = axn . (2)

This has the solution xn = an x0 . It converges to zero if |a| < 1, but it’s the solution
either way.

2. Logistic map. Let

xn+1 = axn (1 − xn )

with 0 < a ≤ 4. If you try some experiments, you’ll see that it generates wildly
different behavior depending on the value of a. You might set x0 = 0.3 and a =
(0.98, 1.5, 2.5, 3.25, 3.5), generate (say) 20 terms, and graph the output. See Wikipedia.
The point, which we won’t develop further, is that even quite simple nonlinear recur-
rences can generate complex behavior.
3. Fibonacci numbers. The Fibonacci numbers are generated by the second order system

fn+1 = fn + fn−1

starting with f0 = 0 and f1 = 1. In matrix terms, we can write this as xn+1 = Axn with
   
fn 1 1
xn = , A = .
fn−1 1 0

This is similar to (2), but here xn is a vector. The matrix A has eigenvalues (λ1 , λ2 )
satisfying λ2 − λ − 1 = 0. The “solution” has the form fn = c1 λn1 + c2 λn2 for constants
(c1 , c2 ) that satisfy the initial conditions.
This is a common example in computer science courses. A recursive version of a Matlab
program to compute Fibonacci numbers is

function answer = f(n)


if n==0
answer = 0;
elseif n==1
answer = 1;
else
answer = f(n-1) + f(n-2);
end
end

Note that the function f refers to itself — it’s recursive in the sense the word is used
in computer science. In Matlab, we would save this as a file called f.m, then call it by
typing (say) f(8) in the command line or as a line in another program. (If you enter a
fraction, it blows up, so a better function would check and generate an error message, or
perhaps convert n to an integer.)

4. Mean and variance. John Cook describes the Welford method of computing the mean and
variance recursively. Consider a sequence of observations: x1 , x2 , . . .. We can compute
rolling estimates of the mean and variance from

Mn = Mn−1 + (xn − Mn−1 )/n


Sn = Sn−1 + (xn − Mn−1 ) ∗ (xn − Mn )

starting with M1 = x1 and S1 = 0. Do a few terms to assure yourself that Mn is the


mean of the first n observations and Sn is the sum of the squared deviations from the
mean. The standard estimator of the variance s2 is therefore Sn /(n − 1) (although I
prefer to divide by n, always).

5. Natural numbers. The natural numbers are the set N = {0, 1, 2, . . .}. We can define them
recursively with the rules: (i) 0 is in N and (ii) if n is in N then so is n + 1.
Which reminds me of an old George Gamov story. In the story, the Hilbert Hotel has an
infinite number of rooms numbered 1, 2, 3, . . .. By law, it must save one for the King, but
the innkeeper fills them all anyway. When asked, he says: “No problem, I can always get

2
an open room by asking everyone to move over one.” And if we move the person in room
j to room 2j, we open up an infinite (countable) number of rooms, all the odd-numbered
ones.
6. Combinatorics. Computer scientist Herbert Wilf notes that many combinatoric identities
satisfy recurrences. For example, the binomial coefficients,
 
n n!
f (n, k) = = ,
k k!(n − k)!
are the solution to
f (n, k) = f (n − 1, k) + f (n − 1, k − 1)
starting with f (n, 0) = 1.
7. Functions. In economics and finance we often run across recursion with functions. Sup-
pose we have a sequence of functions fn (x) over some domain x that satisfy the recurrence
fn+1 (x) = g[fn (x)]
for some g. Even better, suppose the recurrence has a fixed point:
f (x) = g[f (x)].
Here we have an equation in which the unknown is another function f rather than a
number x. It’s similar to (1), but we’re dealing with a more complex object.

2 Recursion in asset pricing

Similar methods show up throughout economics and finance. The idea is to string together
a series of one-period steps — recurrences — similar to those we used earlier in the course.
That allows us to approach the price of (say) an n-period bond with the same methods we
used to price a one-period bond.

We’ll do all this in Markov settings, which require some notation. You’ll recall that modern
asset pricing is based on the no-arbitrage theorem: there exists a positive pricing kernel m
that satisfies E(mr) = 1 for returns r on all assets. In a Markov environment, we need
to keep track of the current state zt and the possible future states zt+1 . The ingredients
include:

• Probabilities. We have a state variable zt and conditional probabilities p(z1+1 |zt ).


• Returns. One-period returns from date t to t + 1 depend on the state in both periods:
r(z, zt+1 ).
• Asset pricing. The no-arbitrage theorem becomes: there exists a positive m(zt , zt+1 )
satisfying
 
Et m(zt , zt+1 )r(zt , zt+1 ) = 1 (3)
for all returns r(zt , zt+1 . Here Et is the expectation conditional on the current state zt
— the expectation computed from p(zt+1 |zt ), in other words.

3
Examples:

1. Bond pricing. A bond of maturity n is a claim to a payment of one in n periods. In a


Markov setting, such bond prices are functions of the state. The question is what the
functions are. We find bond prices recursively, starting with q 0 (zt ) = 1 for all states zt
(a dollar today is worth a dollar). Bonds of longer maturity have returns

rn+1 (zt , zt+1 ) = q n (zt+1 )/q n+1 (zt ).

The no-arb theorem (3) then gives us the recursion

q n+1 (zt ) = Et m(zt , zt+1 )q n (zt+1 ) .


 
(4)

In words: an n + 1-period bond is a claim to an n-period bond in one period.


We’ll spend some time with a loglinear functional form. This takes some work, but it’s
worth doing because we’ll be spending some time with similar models. Despite how it
might look at first, this is a user-friendly functional form. Suppose the pricing kernel is
loglinear:

log m(zt , zt+1 ) = δ + azt + bzt+1


zt+1 = ϕzt + σwt+1

with {wt } a sequence of independent standard normal random variables and 0 < ϕ < 1.
Then bond prices are loglinear functions of the state:

log q n (zt ) = An + Bn zt (5)

for coefficients (An , Bn ) to be determined.


The solution follows from applying (4) to (5). We start with

log q n+1 (zt ) = log Et {exp [log m(zt , zt+1 ) + log q n (zt+1 )]} .

We get the left side from (5). The right side takes some work. The inside of the square
brackets on the right can be expressed

log m(zt , zt+1 ) + log q n (zt+1 ) = (δ + azt + bzt+1 ) + (An + Bn zt+1 )


= δ + An + azt + (b + Bn )(ϕzt + σwt+1 ).

Conditional on the state zt , this is normal with mean and variance

Et [log m(zt , zt+1 ) + log q n (zt+1 )] = δ + An + [a + (b + Bn )ϕ]zt


Vart [log m(zt , zt+1 ) + log q n (zt+1 )] = (b + Bn )2 σ 2 .

The usual “mean plus variance over two” gives us

log Et m(zt , zt+1 )q n+1 (zt+1 ) = log Et exp log m(zt , zt+1 ) + log q n+1 (zt+1 )
   

= δ + An + a + (b + Bn )ϕ zt + (b + Bn )2 σ 2 /2.
 

4
[If this isn’t clear, go through it again, it’s important.] By assumption, this equals
An+1 + Bn+1 zt for all values of zt , so we must have
An+1 = δ + An + (b + Bn )2 σ 2 /2
Bn+1 = a + (b + Bn )ϕ.
Evidently we’ve converted the recursion in q n (zt ), equation (4), into recursions in the
coefficients (An , Bn ). They’re not pretty, but we can easily compute them. The initial
conditions A0 = B0 = 0 correspond to log q 0 (zt ) = log(1) = 0.
2. Equity pricing. A dividend paying stock is a more complicated object. In the same
environment as before, let the dividend in state zt be d(zt ). The ex-dividend value of a
share might be expressed recursively as

v(zt ) = Et m(zt , zt+1 )[d(zt+1 ) + v(zt+1 )] . (6)
In words: equity today is a claim to two things tomorrow, a dividend and the same share
of equity.
Note that the unknown in this equation is the function v. It’s also recursive: you need
to know v on the right to compute v on the left. You’re now as ready as you’ll ever be
for the recursion joke: “To understand recursion, you need to understand recursion.” Or
Google “recursion.” You get back: “Did you mean: recursion?”
One way to think about this is as the limit of a finite horizon. Suppose we value next
period’s dividend by
v 1 (zt ) = Et m(zt , zt+1 )d(zt+1 ) .


The superscript 1 here means we’re valuing one period of dividends. We can value two
periods of dividends recursively with
v 2 (zt ) = Et m(zt , zt+1 )[d(zt+1 ) + v 1 (zt+1 )] .


In general, we can value n + 1 periods of dividends with the recursion


v n+1 (zt ) = Et m(zt , zt+1 )[d(zt+1 ) + v n (zt+1 )] ,


starting with v 0 (zt ) = 0 (the value of zero dividends is zero). As we increase n, we have
more and more dividends. We might imagine, if all goes well, that as n gets larger and
larger, we approach (6).
3. Perpetual American options. Consider the option to buy one share of stock next period
for strike price k. The value today in state zt is
q(zt ) = Et m(zt , zt+1 )[v(zt+1 ) − k]+ ,


where x+ = max{0, x}. Evidently we exercise in states where v(zt+1 ) − k is positive and
not in other states.
A perpetual option allows us to wait. If we don’t exercise now, we can hold the option
for another period. Valuation has a recursive form:
  
q(zt ) = max v(zt ) − k, Et m(zt , zt+1 )q(zt+1 ) .
That is: we either exercise now and get v(zt )−k (the first branch of the max) or continue
to hold the option and get the current value of the option next period (the second branch).

5
3 Bottom line

Recursive methods are at the heart of modern macroeconomics and finance. We’ll use them
extensively to value bonds.

Practice problems

1. Discounted cash flows. Our goal here is to simplify the pricing relation (6) and de-
rive a more conventional valuation of equity as the expected discounted value of future
dividends.
(a) Simplify (6) using m(zt , zt+1 ) = δ and replacing dependence on the state zt with a
subscript t — that is, by replacing v(zt ) with vt .
(b) Use this simplification to express equity’s value as
n
X
vt = δ j Et (dt+j ) + δ n Et (vt+n ).
j=1

(c) What happens as n gets large? What happens to the second term on the right
above?
(d) What does this example leave out that’s present in (6)?
Answer.
(a) Equation (6) becomes

vt = δEt (dt+1 + vt+1 ).

(b) This follows from repeated substitution and the law of iterated expectations.
(c) We hope that the second term goes to zero. That leaves us with the infinite sum

X
vt = δ j Et (dt+j ).
j=1

(d) If m(zt , zt+1 ) = δ there are no risk premiums. The price of equity depends only on
expected future dividends.

2. Consols. A consol pays a constant coupon c every period — forever. They have been
used by the British as a government financing tool since the 1700s. How would you adapt
equation (6) to value such an instrument?
Answer. We set d(zt ) = c, giving us

v(zt ) = Et m(zt , zt+1 )[c + v(zt+1 )] .

The variation in price here comes from m, which translates roughly as variation in interest
rates.

c 2015 David Backus | NYU Stern School of Business

You might also like