# Closed-form analytical solution for Markowitz efficient portfolio without short-selling

In a portfolio without risk-free assets I know that the efficient portfolio si given by: $$\omega=\frac{1}{BC-A^2}[\mu(C\Sigma^{-1}R-A\Sigma^{-1}\mathbb{1})+B\Sigma^{-1}\mathbb{1}-A\Sigma^{-1}R]$$, where:

$$\mu$$ is the portfolio return,

$$R$$ is the vector of the assets' return,

$$A=\mathbb{1}'\Sigma^{-1}R$$,

$$B=R'\Sigma^{-1}R$$,

$$C=\mathbb{1}'\Sigma^{-1}\mathbb{1}$$.

Now I also want that my weights $$\omega_i$$ are positive (i.e. $$\omega_i>0$$), I do not want go short.

How does $$\omega$$ become?

• This would be your starting point; en.m.wikipedia.org/wiki/Quadratic_programming Commented Oct 31, 2020 at 23:40
• Maybe i'm totally confused but if i think of my (long time passed) micro 101 courses, i recall that we spoke of Kuhn-Tucker conditions and positive constraints regarding bundles of goods. If i rewrite your Lagrangean in Merton by adding an additional lagrange multiplier (e.g. $L=x^T\mu-\frac{\gamma}{2}x^T\Sigma{x}+x^T\lambda$ where i add the constraint $x_{i}\geq{0}$ then for each multiplier $\lambda_{i}$ i can rearrange the Lagrangean into an unconstrained optimization problem, where i shift the mean vector by $\mu{'}_{i}=\mu_{i}+\lambda_{i}$ ? Please correct me if i'm wrong , thanks.
– T123
Commented Feb 17, 2023 at 15:11
• $\lambda_i$ is an unknown which has to be found from the KT conditions, so at the outset you don't know by how much you have to "shift" the mean vector $\mu$. AFAIK it is impossible to change the constrained to a an unconstrained problem in this case. Commented Feb 18, 2023 at 19:34
• At best you would need an iterative algorithm, adding some fictitious return $\lambda_i$ (sometimes called convenience yield) to assets that are being shorted until the unconstrained algorithm decides to hold zero amount of those assets. When you specify all the details of how to adjust the $\lambda$s from iteration to iteration and when to stop you would have invented a new (or existing) constrained optimization algorithm Commented Feb 20, 2023 at 16:55
• @nbbo2 Yes, i also had this idea already and i've tried it, hoping it solves my portfolio choice problem faster, however, searching the Lagrange multipliers numerically and then plugging them into the analytical equation compared to solving for the portfolio weights numerically doesn't make a difference in terms of computational speed. Thank you for the idea :-)
– T123
Commented Feb 21, 2023 at 10:20

If you're asking how to use or modify the closed-form analytical solution you showed, consisting of the building blocks $$A$$, $$B$$ and $$C$$, as derived by Merton in 1972, you can't. That is intended for solving the unconstrained portfolio only. There is no analytical solution for the constrained portfolio because of frictions with the non-negativity requirement, therefore, it can only be solved with convex optimization (quadratic programming).
• I presented all the formulas in order to let you know exactly what I was referring to. I was asking if there exists an analytical formula for $\omega$ in the case of positive weights Commented Nov 1, 2020 at 11:15