Building the Optimal Portfolio

Let’s consider a scenario where a bank has 100 million dollars, and it plans to allocate this capital between loans and securities. Loans offer a high interest (10\%), while securities provide a lower interest (5\%) but come with the advantage of liquidity: at any time, they can be sold at market value. Let L and S be the amounts of money in loans and securities. The bank aims to maximize its return, defined as 0.1L + 0.05S, subject to various constraints:

[1] Sign constraints – L \ge 0, S \ge 0.

[2] Total-funds constraint – Assuming that the total amount available for investment is 100 (in millions of dollars). i.e.,

L + S\le 100.

[3] Liquidity constraint – Due to Federal Reserve requirements, the bank wishes to keep at least 25\% of its invested funds liquid. It means S \ge 0.25 (L+S), or

L-3S \le 0.

[4] Load-balance constraint – The bank has certain big clients it never wants to disappoint. If they want loans, they shall have loans. The bank expects its prime clients to ask for loans totaling 30 million dollars, and so L must be at least that big:

L \ge 30.

If L and S satisfy all four constraints, then L and S make up a feasible portfolio. A feasible portfolio is an optimal portfolio if its L and S maximize the return

0.1L+0.05S.

To find the optimal portfolio, the bank solves the following optimization problem:

Maximize the linear objective function

R = 0.1L+0.05S\quad\quad\quad(*)

subject to the linear constraints:

\begin{cases} L \ge 0, S\ge 0,\quad\quad\;(1)\\ L + S\le 100,\quad\quad\;(2)\\L-3S \ge 0,\quad\quad\quad(3)\\L \ge 30.\quad\quad\quad\quad\quad(4)\end{cases}

In Fig. 1, a graphical representation illustrates the constraints imposed by (1), (2), (3) and (4). Any pair of values of (L, S) within the shaded region satisfies all these constraints. Conversely any point in this region will have coordinates which satisfy the inequality (1), (2), (3) and (4). So every feasible solution is a point in the region and every point in the region is a feasible solution. A feasible solution that yields the greatest quantity R in (*) is an optimal solution.

Fig. 1

The expression (*) can be written as

S = -2L + \underbrace{R/0.05}_{S-intercept}.\quad\quad\quad(**)

Fig. 2

In a L-S coordinate system, this is a line with slope -2 and a S-intercept of \frac{R}{0.05}. A feasible line passes through the feasible point(s) in the shaded region (see Fig. 2). The S-intercept is directly proportional to R, so the further the S-intercept is from the origin, the greater the return (R) by the feasible point(s) (L, S) on the feasible line.

Fig. 3

In Fig. 3, three parallel lines with slope -2 are drawn through points O, P, and Q. The point O, with the greatest S-intercept, yields the highest return. Therefore,

The point O is the optimal solution.

Fig. 4

The coordinates of O (see Fig. 4) reval that the optimal portfolio has L=75, S=25, and the maximized return is 8.75 million.

See also “See ‘maximize_lp’ In Action“.


Exercise-1 Verify the optimal solution using a CAS. hint: “See ‘maximize_lp’ In Action

Exercise-2 Without using a CAS, solve the problem in “See ‘maximize_lp’ In Action“.

Empowering CAS

The maximum height h_{max} for both cases of n in “A Journey Skyward” can be verified as follows:

First, solve initial-value problem \begin{cases} v'(t) = -g-kv(t)^n \\ v(0) = u  \end{cases} for v(t).

Then, obtain t_{max}, the time it takes for the ball to reach the maximum height from algebraic equation v(t_{max} ) = 0.

Lastly, definite integral \displaystyle \int\limits_{0}^{t_{max}}v(t)\;dt gives h_{max}.

For n=1, we have

Fig. 1 n=1

And, n=2:

Fig. 2 n=2

There is an alternative:

Solve \begin{cases} h''(t) = -g-kh'(t)^n \\ h(0) = 0, h'(0)=u  \end{cases} for h(t) first.

Obtain t_{max} from h'(t_{max} ) = 0 next.

h(t_{max}) then gives h_{max}.

For example,

Fig. 3 n=1

However, this approach meets a dead-end when n=2 – ‘ode2’ solves the differential equation but fails to get the particular solution that satisfies the initial conditions:

contrib_ode‘ fares worse: it can’t even solve the differential equation:

Only with manual interventions, the CAS is empowered to verify h_{max} successfully:

Fig. 4 n=2


Exercise-1 Explain the manual interventions.