Exponential-utility portfolio with nonnegative cash (source code)

= Exponential-utility portfolio with nonnegative cash
{title2=$\theta^*=M[\mu-\max(1+r,\eta)S_0]$}

For Gaussian terminal prices with positive definite covariance $V$, set $M=(\gamma V)^{-1}$ and $\eta=(S_0^TM\mu-w_0)/(S_0^TMS_0)$, assuming $S_0\ne0$. The normal moment-generating function turns expected exponential utility into a strictly concave mean-minus-variance objective. Its free optimum has cash $S_0^TMS_0(1+r-\eta)$. If this is positive, keep the free optimum; otherwise the cash constraint binds and the multiplier becomes $\eta$. Thus zero optimal cash is equivalent to $\eta\geq1+r$, including equality.