Skip to main content

The perpetual bond problem

Author
Affiliation

Department of Economics, University of Houston

Published

November 30, 2026

Part of Math Camp: An Introduction to Mathematics and Statistics with Applications in Economics.
Main Stam4Econ site | View this section in the book | Author: Fan Wang | DOI: 10.5281/zenodo.24696926
Date: 2026-11-30 | HTML | PDF | QMD

1 The perpetual bond problem

1.1 The perpetual bond problem

An individual receives \(y_1\) units of income in period 1, and \(y_f\) units of income in all future periods. In each period, consumption is \(c_t\). In period 1, the individual makes a once-in-a-life time decision on investing in a perpetual bond \(b\) that will return \(r\) units of interest in all future periods. The individual can not borrow.

Assume \(0<\beta<1\), \(y_1>0\), \(y_f>0\), and \(r>0\). Given log utility:

\[ U(c_1, c_f) = \log(c_1) + \sum_{t=1}^{\infty} \beta^{t} \log(c_f) \\ \]

where \(\beta\) is the discount factor, which is less than 1. The life-time consumption and bond optimization problem can be formulated as:

\[ \max_{c_1, c_f, b} \quad U(c_1, c_f) \\ \]

subject to:

\[\begin{align*} c_1 + b &\le y_1 \\ c_f &\le y_f + r b\\ c_1, c_f & > 0\\ b &\ge 0 \end{align*}\]

1.2 The perpetual bond problem, from constrained to unconstrained

Often, a way to solve a constrained optimization problem with many constraints and choices is to substitute the constraints into the objective function, and then solve the resulting unconstrained optimization problem. We have an example here where we can easily turn the problem into an almost unconstrained optimization problem.

First, given log utility, we know that the two budget constraints will bind at the optimum, so we can substitute them into the objective function and replace \(c_1\) and \(c_f\). The reduced choice set is \(0 \leq b < y_1\): the upper bound ensures \(c_1>0\) and is also required for the logarithm to be defined. The optimization problem is only with respect to \(b\):

\[ \max_{b} \quad U(y_1 - b, y_f + r b) \\ \text{subject to} \quad -b \le 0 \]

We are left with a single constraint and a single choice. Note that we converted our constraint so that it is in the form of \(g(x) \le c\). We have the Lagrangian:

\[ \mathcal{L}(b, \lambda) = \log(y_1 - b) + \frac{\beta}{1 - \beta} \log(y_f + r b) - \lambda (-b) \]

where \(\lambda\) is the lagrange multiplier.

1.3 Single constraint KKT condition check

Given the lagrangian above, we can write out the KKT conditions for this problem. Then we walk through alternative paths of lagrange multiplier values to explore, at optimal choices, whether the constraint is binding. We are dealing with a one choice and one constraint problem here, but the condition checking below is already somewhat long. KKT-based condition checking is a very powerful way of solving problems, but should be best left for a computer to execute.

The KKT conditions are:

\[ \begin{gathered} (C1)\quad \frac{\partial \mathcal{L}}{\partial b} = -\frac{1}{y_1 - b^{\ast}} + \frac{\beta r}{(1 - \beta)(y_f + r b^{\ast})} + \lambda^{\ast} = 0\\ (C2)\quad b^{\ast} \geq 0\\ (C3)\quad \lambda^{\ast} \geq 0\\ (C4)\quad \lambda^{\ast} b^{\ast} = 0 \end{gathered} \]

There are two possible paths. Along the first path, suppose that \(\lambda^{\ast} >0\) (C3), then by C4, we must have \(b^{\ast} = 0\), which satisfy C2 as well. The individual does not invest in the bond at all. Then using \(C1\), we have:

\[\begin{align} 0 &< \lambda^{\ast} = \frac{1}{y_1} - \frac{\beta r}{(1 - \beta)(y_f)}\\ 0 &< \frac{1}{y_1} - \frac{\beta r}{(1 - \beta)(y_f)}\\ \end{align}\]

which becomes:

\[\begin{align} \left(\frac{\beta }{1 - \beta}\right) r &< \frac{y_f}{y_1}\\ \end{align}\]

If the condition above is satisfied, then the this first path provides the optimal choice, which is not to buy the perpetual bond. The condition is more likely to be satisfied if there is relative more income in each future period than in period 1, which should reduce the incentive to save via bond. The condition is more likely to be satisfied if interest rate is lower, which should reduce the incentive to save via bond. The condition is more likely to be satisfied if the discount factor is lower, which should reduce the incentive to save via bond (when \(\beta\) is zero, the left-hand-side is zero).

Note here the importance of setting the constraint as \(-b \le 0\) when constructing the lagrangian. If we plugged into the lagrangia \(-\lambda b\) (rather than \(-\lambda (-b)\)), the inequality would have have been reversed, with wrong comparative statics implications.

Consider now the second path, where \(\lambda^{\ast} = 0\) (C3), which satisfies (C4). Then using \(C1\), we have the first order condition from the unconstrained problem without the lagrange multiplier term:

\[ \frac{1}{y_1 - b^{\ast}} = \frac{\beta r}{(1 - \beta)(y_f + r b^{\ast})} \]

Solving for \(b^{\ast}\), we cross multiply and rearrange to get:

\[\begin{align} (1-\beta)y_f + (1-\beta)r b^{\ast} &= \beta r y_1 - \beta r b^{\ast} \\ % (1-\beta)y_f + (1-\beta + \beta)r b^{\ast} &= \beta r y_1 \\ (1-\beta)y_f + r b^{\ast} &= \beta r y_1 \\ % b^{\ast} &= \frac{\beta r y_1 - (1-\beta)y_f}{r}\\ b^{\ast} &= \beta y_1 - \frac{(1-\beta)}{r}y_f \end{align}\]

By C2, we must have \(b^{\ast} \geq 0\), which means that:

\[\begin{align} \beta y_1 - \frac{(1-\beta)}{r}y_f &\geq 0\\ \frac{\beta}{1-\beta}r \ge \frac{y_f}{y_1} \end{align}\]

Note that this condition here is exactly the opposite of the condition we derived in the first path. If this condition is satisfied, then the second path provides the optimal choice, which is to invest positive levels in \(b^{\ast}\).

Generally, for single constraint and single choice optimization problem, we don’t have to go through the KKT conditions, the solution can be written as the optimal constrained b choice is equal to the optimal unconstrained choice, if the unconstrained choice would have be positive, and zero otherwise. Specifically, we can write the optimal choice as:

\[\begin{align} b^{\ast} &= \max\left(0, \beta y_1 - \frac{(1-\beta)}{r}y_f\right)\\ \end{align}\]

or

\[ b^{\ast, con} = \begin{cases} b^{\ast, unc} & \text{if } b^{\ast, unc} > 0 \\ 0 & \text{otherwise } \end{cases} \quad \]

1.4 The perpetual bond problem, gradients with 3 choices and five constraints

The original problem has three choices and five inequality constraints. Solving this as a constrained optimization problem, we can use the KKT conditions.

First, let \(x=[c_1, c_f, b]\) by a 3 by 1 vector.

Second we rewrite the constraints so that they are all less than or equal to a constant:

\[\begin{align*} g_1(x) = c_1 + b &\le y_1 \\ g_2(x) = c_f - r b &\le y_f \\ g_3(x) = -c_1 & \le 0\\ g_4(x) = -c_f & \le 0\\ g_5(x) = -b &\le 0 \end{align*}\]

Third, we are dealing with linear constraints, so the Jacobian is just the coefficients in front of the elements of \(x\). The Jacobian of the constraints \(g(x)\) with respect to \(x\) is a 5 by 3 matrix:

\[ J_g(x) = \begin{bmatrix} 1 & 0 & 1 \\ 0 & 1 & -r \\ -1 & 0 & 0 \\ 0 & -1 & 0 \\ 0 & 0 & -1 \end{bmatrix} \]

Fourth, using properties geometric series, we can rewrite the objective function as:

\[ f(x) = U(c_1,c_f) = \log(c_1) + \frac{\beta}{1 - \beta} \log(c_f) \]

And the gradient of the scalar-valued function \(f\) with respect to \(x\) is:

\[ \nabla f(x) = \begin{bmatrix} \frac{1}{c_1} \\ \frac{\beta}{(1 - \beta)c_f} \\ 0 \end{bmatrix} \]

Fifth, note that our for KKT, we need to satisfy the following conditions:

\[ \begin{gathered} \nabla_x f(x^{\ast}) = J_g(x^{\ast})^T \lambda^{\ast}\\ \left(\lambda^{\ast}\right)^T (g(x^{\ast}) - c) = 0\\ \lambda^{\ast} \ge 0\\ g(x^{\ast}) \le c \end{gathered} \]

We can begin working on this, trying out alternative values of the lagrange multipliers and test out whether they could plausibly jointly satisfy all four sets of equations above. This can be a very cumbersome process, although the problem we are dealing with here is fairly simple.

1.5 The perpetual bond problem, inputs for constrained optimization solver

Rather than solving out the tree of possibilities by hand. Programs like matlab are designed to solve exactly this type of problems. Matlab requires several inputs:

  1. the utility objective function
  2. the jacobian
  3. the vector of values that \(g(x)\) is less than
  4. starting value guess for the three choices.

Given our set up, we now create matlab code that uses the matlab function fmincon to solve this constrained optimization problem. The code should define the objective function, the constraints, and call fmincon to find the optimal solution.

% Parameters
y1 = 10;      % Income in period 1
yf = 5;       % Income in future periods
r = 0.1;      % Interest from bond
beta = 0.95;  % Discount factor

% Objective function
f = @(x) -(log(x(1)) + (beta/(1-beta))*log(x(2))); % Negative for minimization

% Inequality constraints: A*x <= b
A = [1 0 1;    % c1 + b <= y1
      0 1 -r;   % c_f - r*b <= y_f
      -1 0 0;   % -c1 <= 0
      0 -1 0;   % -c_f <= 0
      0 0 -1];  % -b <= 0
b_vec = [y1; yf; 0; 0; 0];

% Initial guess
x0 = [1; 1; 1];

% Call fmincon
options = optimoptions('fmincon', 'Display', 'iter', 'Algorithm', 'interior-point');
[x_opt, fval, exitflag, output] = fmincon(f, x0, A, b_vec, [], [], [], [], [], options);

% Display results
c1_opt = x_opt(1);
cf_opt = x_opt(2);
b_opt = x_opt(3);
fprintf('Optimal c1: %.4f\nOptimal cf: %.4f\nOptimal b: %.4f\n', c1_opt, cf_opt, b_opt);