---
# System prepended metadata

title: 'Optimizing Portfolio Weights for Maximum CRRA Utility: An Independent Binary Asset Model'

---

# Optimizing Portfolio Weights for Maximum CRRA Utility: An Independent Binary Asset Model

**Summary**
This article explores the optimization of portfolio weights to maximize a Constant Relative Risk Aversion (CRRA) utility function over an agent's wealth. We use classic stochastic calculus techniques to model price processes as Geometric Brownian Motion (GBM). We find our solution is, in fact, an extension of the famous Merton Share. 

---

**Caveats and Extensions**

The model we present above is a strong oversimplification of the investment environment we find ourselves in in real life. In future extensional work, I hope to generalize this model a bit to include some important aspects of practical investing life. 

The primary simplification we make is the way we model price processes. In practice, we don't have access to nicely behaved independent GBM processes with known stationary parameters. In the wild, asset prices are fat-tailed, non-stationary, correlated (typically increasingly so at the worst times), and with unknown parameters. Investing also incurs a number of important costs like exchange fees, slippage through price impact, margin costs, and taxes. 

We also note that our CRRA utility function is just an approximation of one's true utility over wealth$–$though in another essay sometime I might write a defense strengthening my support for constant relative risk aversion utility functions. If I have time I might extend this analysis to the more flexible hyperbolic absolute risk aversion (HARA) utility functions. 

Another extension I hope to make is to generalize beyond the dual-asset model to a multi-asset framework. Similarly, I think we can relax our independence assumption by adding known stationary covariance between price processes. With these caveats and possible extensions in mind, we proceed to defining our model. 

---

**Model Definition**
Suppose we have a universe of two stocks, $A$ and $B$, modeled as independent GBM processes with parameters $\mu_A$, $\mu_B$, $\sigma_A$, and $\sigma_B$. We also define $\lambda_A$ and $\lambda_B$ to be our portfolio weights for assets $A$ and $B$, such that $\lambda_A + \lambda_B = 1$. Finally, we have a CRRA utility function over possible wealth states $W$ such that $U(W) = \frac{W^{1-\gamma} - 1}{1 - \gamma}$ and $\gamma$ is our relative risk aversion parameter. In what follows, we attempt to find the optimal portfolio weights $\lambda$ which maximize the expected utility of our future wealth.

---

**Deriving a Closed Form Expected Utility Function**

We intend to find the portfolio allocation $[\lambda_A, \lambda_B]$ which maximizes the expected utility of our wealth in the next period, that is:
$$\underset{\lambda_A, \lambda_B}{\max} \, E[U(W_{t+dt})].$$

Incorporating our CRRA utility function yields $E[U(W_{t+dt})] = E\left[\frac{(W_t + dW_t)^{1-\gamma} - 1}{1-\gamma}\right]$.

We can now define our wealth dynamic $dW_t$ as evolving according to the chosen portfolio weights $\lambda_A$ and $\lambda_B$

$$dW_t = \lambda_A W_t \frac{dS_{A,t}}{S_{A,t}} + \lambda_B W_t \frac{dS_{B,t}}{S_{B,t}}.$$

Similarly, we note that each stock's price follows a GBM, defined by the stochastic differential equations (SDEs)
\begin{align*}
dS_{A,t} &= \mu_A S_{A,t} \, dt + \sigma_A S_{A,t} \, dN_{A,t} \\
dS_{B,t} &= \mu_B S_{B,t} \, dt + \sigma_B S_{B,t} \, dN_{B,t},
\end{align*}
where $N_{i,t}$ is our notation for Wiener process on asset $i$ at time $t$. 

Substituting both individual asset processes into our wealth SDE yields

$$dW_t = \lambda_A \frac{W_t}{S_{A,t}} (\mu_A S_{A,t} \, dt + \sigma_A S_{A,t} \, dN_{A,t}) + \lambda_B \frac{W_t}{S_{B,t}} (\mu_B S_{B,t} \, dt + \sigma_B S_{B,t} \, dN_{B,t}),$$

which we can simplify to

$$dW_t = W_t \left[ \lambda_A (\mu_A \, dt + \sigma_A \, dN_{A,t}) + \lambda_B (\mu_B \, dt + \sigma_B \, dN_{B,t}) \right].$$

Now, we can substitute this into our expected utility equation:

$$E[U(W_{t+dt})] = E\left[\frac{(W_t + W_t (\lambda_A (\mu_A dt + \sigma_A dN_{A,t}) + \lambda_B (\mu_B dt + \sigma_B dN_{B,t})))^{1-\gamma}-1}{1-\gamma}\right].$$

From here, we begin the process of simplifying this expectation to:

$$\frac{E\left[(W_t + W_t (\lambda_A (\mu_A dt + \sigma_A dN_{A,t}) + \lambda_B (\mu_B dt + \sigma_B dN_{B,t})))^{1-\gamma}\right] - 1}{1-\gamma}.$$

Then we can pull the $W_t^{1-\gamma}$ out of the expectation yielding

$$\frac{W_t^{1-\gamma} E\left[\left(1 + \lambda_A (\mu_A dt + \sigma_A dN_{A,t}) + \lambda_B (\mu_B dt + \sigma_B dN_{B,t})\right)^{1-\gamma}\right] - 1}{1-\gamma}.$$

We now consider the second-order Taylor series expansion of $E[(1 + x)^{1-\gamma}]$ around 1 because we know $x$ will be very small since we're dealing with an infinitesimally small time increment $dt$. In this case, $x=\lambda_A (\mu_A dt + \sigma_A dN_{A,t}) + \lambda_B (\mu_B dt + \sigma_B dN_{B,t})$.

We remember that the Taylor series of a function $f(x)$ around a point $a$ is given by

$$f(x) = f(a) + f'(a)(x - a) + \frac{f''(a)}{2!}(x - a)^2 + \ldots$$

and we are careful to make sure to include the second order term which includes our volatility parameters.

This implies that $E[(1 + x)^{1-\gamma}] \approx 1 + (1 - \gamma)E[x] + \frac{(1 - \gamma)(-\gamma)}{2} E[x^2]$.

Using $x=\lambda_A (\mu_A dt + \sigma_A dN_{A,t}) + \lambda_B (\mu_B dt + \sigma_B dN_{B,t})$, we see that $E[x] = (\lambda_A \mu_A + \lambda_B \mu_B)dt$ because $E[dN_{i,t}]=0$.

Furthermore, to solve for $E[x^2]$, we substitute in $x$ which gives us
$$E[x^2] = E[(\lambda_A (\mu_A dt + \sigma_A dN_{A,t}) + \lambda_B (\mu_B dt + \sigma_B dN_{B,t}))^2].$$

From here, we expand out the expression to 

$$E[x^2] = E[(\lambda_A (\mu_A dt + \sigma_A dN_{A,t}))^2 + 2 \lambda_A  \lambda_B (\mu_A dt + \sigma_A dN_{A,t}) (\mu_B dt + \sigma_B dN_{B,t}) + (\lambda_B (\mu_B dt + \sigma_B dN_{B,t}))^2].$$

We now have to do some algebra to untangle this a bit further by expanding each of these terms.

$$(\lambda_A (\mu_A dt + \sigma_A dN_{A,t}))^2 = \lambda_A^2 \mu_A^2 dt^2 + 2\lambda_A^2 \mu_A \sigma_A dt \, dN_{A,t} + \lambda_A^2 \sigma_A^2 dN_{A,t}^2$$

$$(\lambda_B (\mu_B dt + \sigma_B dN_{B,t}))^2 = \lambda_B^2 \mu_B^2 dt^2 + 2\lambda_B^2 \mu_B \sigma_B dt \, dN_{B,t} + \lambda_B^2 \sigma_B^2 dN_{B,t}^2$$

$$2\lambda_A \lambda_B (\mu_A dt + \sigma_A dN_{A,t})(\mu_B dt + \sigma_B dN_{B,t}) = 2\lambda_A \lambda_B \mu_A \mu_B dt^2 + 2\lambda_A \lambda_B \mu_A \sigma_B dt \, dN_{B,t} + 2\lambda_A \lambda_B \mu_B \sigma_A dt \, dN_{A,t} + 2\lambda_A \lambda_B \sigma_A \sigma_B dN_{A,t} dN_{B,t}$$

At this point, some properties of Brownian motion come to our aid, particularly that $E[dN_{i,t}]=0$, $E[dN_{i,t}^2]=dt$, and $E[dN_{A,t} dN_{B,t}]=0$ (since $A$ and $B$ are independent processes).

We can make the following simplifications:

$$(\lambda_A (\mu_A dt + \sigma_A dN_{A,t}))^2 = \lambda_A^2 \sigma_A^2 dt$$

$$(\lambda_B (\mu_B dt + \sigma_B dN_{B,t}))^2 = \lambda_B^2 \sigma_B^2 dt$$

$$2\lambda_A \lambda_B (\mu_A dt + \sigma_A dN_{A,t})(\mu_B dt + \sigma_B dN_{B,t}) = 0$$

Putting it all together, the simplified expression for $E[x^2] = \lambda_A^2 \sigma_A^2 dt + \lambda_B^2 \sigma_B^2 dt$. 

Returning back to the earlier expectation we've been trying to solve with these new results in hand, we see that 

$$E[(1 + x)^{1-\gamma}] = 1 + (1 - \gamma)(\lambda_A \mu_A + \lambda_B \mu_B)dt + \frac{(1 - \gamma)(-\gamma)}{2} (\lambda_A^2 \sigma_A^2 dt + \lambda_B^2 \sigma_B^2 dt).$$

This means we can now write our full expected utility maximization equation as: 

$$E[U(W_{t+dt})] = \frac{W_t^{1-\gamma} \left(1 + (1 - \gamma)(\lambda_A \mu_A + \lambda_B \mu_B)dt + \frac{(1 - \gamma)(-\gamma)}{2} (\lambda_A^2 \sigma_A^2 + \lambda_B^2 \sigma_B^2)dt\right) - 1}{1-\gamma}$$

> Quick aside, my hunch is that if we were to extend to a multi-asset model this becomes:
> $E[U(W_{t+dt})] = \frac{W_t^{1-\gamma} \left(1 + (1 - \gamma)\left(\sum_{i=1}^{n} \lambda_i \mu_i\right)dt + \frac{(1 - \gamma)(-\gamma)}{2} \left(\sum_{i=1}^{n} \lambda_i^2 \sigma_i^2\right)dt\right) - 1}{1-\gamma}$

Now, because we're in a dual-asset model where the weights sum to 100%, $\lambda_B$ is determined to be $1-\lambda_A$. We can subsitute this into the expression above which gives us:
$$E[U(W_{t+dt})] = \frac{W_t^{1-\gamma} \left[1 + (1 - \gamma)(\lambda_A \mu_A + (1-\lambda_A) \mu_B)dt + \frac{(1 - \gamma)(-\gamma)}{2} (\lambda_A^2 \sigma_A^2 + (1-\lambda_A)^2 \sigma_B^2)dt\right] - 1}{1-\gamma}$$

---

**Optimizing Portfolio Weights to Maximize Expected Utility**

In order to maximize $E[U(W_{t+dt})]$, we can follow the classic method of differentiating the function with respect to $\lambda_A$ and setting this partial derivative equal to zero.

First, we notice that the term $\frac{W^{1-\gamma} - 1}{1 - \gamma}$ is a constant with respect to $\lambda_A$, so we can focus on differentiating only the bracketed expression, which we can denote as $f(\lambda_A)$:

$$f(\lambda_A) = 1 + (1 - \gamma)(\lambda_A \mu_A + (1 - \lambda_A) \mu_B)dt + \frac{(1-\gamma)(-\gamma)}{2} \left( \lambda_A^2 \sigma_A^2 + (1 - \lambda_A)^2 \sigma_B^2 \right) dt.$$

Now, we differentiate $f(\lambda_A)$ with respect to $\lambda_A$:

$$\frac{df}{d\lambda_A} = (1 - \gamma) (\mu_A - \mu_B) dt + (1 - \gamma)(-\gamma) \left( \lambda_A \sigma_A^2 - (1 - \lambda_A) \sigma_B^2 \right) dt.$$

This simplifies to:

$$\frac{df}{d\lambda_A} = (1 - \gamma) (\mu_A - \mu_B) dt + (1 - \gamma)(-\gamma) \left( \lambda_A (\sigma_A^2 + \sigma_B^2) - \sigma_B^2 \right) dt.$$

To find the optimal $\lambda_A$, set $\frac{df}{d\lambda_A} = 0$ and solve for $\lambda_A$:

$$(1 - \gamma) (\mu_A - \mu_B) dt + (1 - \gamma)(-\gamma) \left( \lambda_A (\sigma_A^2 + \sigma_B^2) - \sigma_B^2 \right) dt = 0.$$

We can see that $(1 - \gamma) dt$ is a common factor in both terms, and since $dt$ is an infinitesimal time increment (which importantly is not zero), we can simplify the equation by dividing through by $(1 - \gamma) dt$:

$$\mu_A - \mu_B - \gamma (\lambda_A (\sigma_A^2 + \sigma_B^2) - \sigma_B^2) = 0.$$

Now we rearrange the equation to solve for $\lambda_A$:

$$\gamma \lambda_A (\sigma_A^2 + \sigma_B^2) = \mu_A - \mu_B + \gamma \sigma_B^2$$

$$\lambda_A (\sigma_A^2 + \sigma_B^2) = \frac{\mu_A - \mu_B + \gamma \sigma_B^2}{\gamma}$$

From this we have found our optimal $\lambda_A$:

$$\lambda_A = \frac{\mu_A - \mu_B + \gamma \sigma_B^2}{\gamma (\sigma_A^2 + \sigma_B^2)}.$$

The optimal $\lambda_B$ follows easily:

$$\lambda_B = 1 - \frac{\mu_A - \mu_B + \gamma \sigma_B^2}{\gamma (\sigma_A^2 + \sigma_B^2)} = \frac{\mu_B - \mu_A + \gamma \sigma_A^2}{\gamma (\sigma_A^2 + \sigma_B^2)}.$$

---

**Conclusion**

Given two assets modeled as independent GBM processes, wealth $W_t$, and a CRRA utility function, we have found that the optimal allocation to asset $A$ is $\lambda_A = \frac{\mu_A - \mu_B + \gamma \sigma_B^2}{\gamma (\sigma_A^2 + \sigma_B^2)}$ and the optimal allocation to asset $B$ is $\lambda_B = \frac{\mu_B - \mu_A + \gamma \sigma_A^2}{\gamma (\sigma_A^2 + \sigma_B^2)}$.

You might have noticed that the portfolio allocations $\lambda_A$ and $\lambda_B$ don't have a subscript $t$. This is because, given that the price processes are stationary and that our risk aversion parameter $\gamma$ does not change, they are time and wealth independent! This implies a constant fractional allocation to each stock in our portfolio. 

Notably, in the case where $B$ is a risk-free investment, implying that $\sigma_B^2=0$, our optimal allocation reduces to $\lambda_A = \frac{\mu_A - \mu_B}{\gamma \sigma_A^2}$, which is the famous Merton Share! 

While all models are lossy, I take issue with the idea of a risk-free rate. In particular, the real returns on a nation's treasuries are sensitive to interest rate changes, inflation, and currency fluctuations. It also shouldn't be overlooked that big debt crises occur fairly regularly and nations do default. With this in mind, I think extending the dual-asset Merton Share model to two risky assets is an improvement toward realism.
