Path: blob/main/notebooks/06/03-markowitz-portfolio-revisited.ipynb
663 views
6.3 Markowitz portfolio optimization revisited
Preamble: Install Pyomo and a solver
This cell selects and verifies a global SOLVER for the notebook.
If run on Google Colab, the cell installs Pyomo and ipopt, then sets SOLVER to use the ipopt solver. If run elsewhere, it assumes Pyomo and the Mosek solver have been previously installed and sets SOLVER to use the Mosek solver via the Pyomo SolverFactory. It then verifies that SOLVER is available.
Problem description and model formulation
Consider again the Markowitz portfolio optimization we presented earlier in Chapter 5. Recall that the matrix describes the covariance among the uncertain return rates , . Since is positive semidefinite by definition, it allows for a Cholesky factorization, namely . We can then rewrite the quadratic constraint as and thus as using the Lorentz cone. In this way, we realize that the original portfolio problem we formulated earlier is in fact a conic quadratic optimization problem, which can thus be solved faster and more reliably. The optimal solution of that problem was the one with the maximum expected return while allowing for a specific level of risk.
However, an investor could aim for a different trade-off between return and risk and formulate a slightly different optimization problem, namely
where is a risk tolerance parameter that describes the relative importance of return vs. risk for the investor. The risk, quantified by the variance of the investment return , appears now in the objective function as a penalty term. Note that even in this new formulation we have a conic problem since we can rewrite it as
Solving for all values of , one can obtain the so-called efficient frontier.
Solver status: ok, optimal
Solution: , , ,
Maximizes objective value to: