Skip to content
All library documents

Using an HJB Equation to Optimize Leverage with Ongoing Costs

Article Quant Q&A · Author: Freelunch

Summary

The document asks how to choose portfolio leverage when wealth follows a diffusion with proportional exposure to a risky asset and a constant cost paid over time. Without costs, power utility gives a closed-form leverage rule, with log utility corresponding to the Kelly criterion. The added cost and possible bankruptcy complicate expected-utility optimization, motivating a value-function approach.

The reply formulates a Hamilton–Jacobi–Bellman equation for terminal power utility shifted by a positive constant, then maximizes its instantaneous terms over leverage. It proposes a time-varying power-form value function and reports differential equations for its exponent and scale. This is a derivation offered in a forum answer, and the author explicitly invites readers to identify computational mistakes. The HJB conditions, concavity, boundary behavior at bankruptcy, and proposed ansatz are not fully established, so the resulting expression should be checked before practical use.

Key ideas

  • With proportional risky exposure and no fixed cost, power utility yields a closed-form leverage choice.
  • A constant cost changes the wealth dynamics and can create a positive probability of bankruptcy.
  • The proposed solution uses an HJB equation and maximizes its terms over leverage.
  • The reply assumes a particular value-function form and acknowledges that its calculations may contain errors.

Tags

Full text
# Utility-optimal leverage with costs


# Utility-optimal leverage with costs












Say I have a portfolio, $X_t$, using a leverage of $f$, such that the dynamics are given by \begin{equation} dX_t = \mu f X_t dt + \sigma f X_t dW_t \end{equation} I want to optimize the expected utility after some time $T$, $E[U(V_T)]$, and find the optimal leverage $f$. With the utility function $U(x)=\frac{x^\gamma}{\gamma}$ this is fairly easy. The SDE can be solved and the expected utility is maximized with $f^* = \frac{\mu}{\sigma^2 (1-\gamma)}$. With $\gamma=0$ and log-utility this is just the Kelly criterion.

But what if I also have to pay a constant cost $C$ such that the dynamics are \begin{equation} dX_t = (\mu f X_t - C) dt + \sigma f X_t dW_t, \quad X_t > 0 \end{equation} and $dX_t = 0$ when $X_t=0$ (i.e., I go bankrupt). The utility function would need to be altered to account for the non-zero probability of bankruptcy, so $U(x)=\frac{(x + b)^\gamma}{\gamma}$ with some $b>0$ so that the utility is bounded at bankruptcy.

Is there any way I can formulate the problem such that I can get an expression for the optimal $f^*$ that maximizes the expected utility $E[U(V_T)]$ when costs are included?

## Answer by M. Jeunesse (score 2)

https://quant.stackexchange.com/a/32435

I hope my computations are correct.

Let $u(t,x)=\max_{(f_s)_{s\geq t}}\mathbb{E}[(b+X^{f_.}_T)^\gamma]$.

Using HJB (you have to prove that it is ok to use it).

$$0=\max_{f}\partial_t u(t,x)+(\mu f x - C)\partial_x u(t,x)+\frac{\sigma^2}{2}f^2x^2\partial_{xx}u(t,x)$$ Since $\partial_{xx}u(t,x)<0$ (prove it), maximum is hit at $f=\frac{\mu x \partial_xu(t,x)}{\sigma^2 x^2\partial_{xx}u(t,x)}$

$$0=\partial_t u(t,x)- C\partial_x u(t,x)-\frac{\mu^2}{2\sigma^2}\frac{(\partial_x u(t,x))^2}{\partial_{xx}u(t,x)}$$

We postulate $u(t,x)=f(t)(b+x)^{\gamma(t)}$

one has : $$ 0 = f'(t)(b+x)^{\gamma(t)}+\gamma'(t)(b+x)^{\gamma(t)-1} - C \gamma(t) (b+x)^{\gamma(t)-1}-\frac{\mu^2}{2\sigma^2}\frac{(b+x)^{\gamma(t) } }{\gamma(t)-1}$$

And finally we have : $$0=\gamma'(t) - C \gamma(t)\text{ and }\gamma(T)=\gamma$$ and $$f'(t)= \frac{\mu^2}{2\sigma^2(\gamma(t)-1)}\text{ and }f(T)=1$$

which leads to:

$$u(t,x)= (b+x)^{\gamma e^{-C(T-t)}}\left(1-\int_{t}^T\frac{\mu^2}{2\sigma^2(\gamma e^{-C(T-s)}-1)}ds\right)$$

Post in comments, if you see computation mistakes.

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.