Path: blob/main/notebooks/09/01-markowitz-portfolio-with-chance-constraint.ipynb
663 views
9.1 Markowitz portfolio optimization with chance constraints
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 the ipopt solver via the IDEAS repository, 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
We consider here another variant of the Markowitz portfolio optimization problem, which we already encountered in the context of convex optimization here and in the context of conic optimization here.
Assuming there is an initial unit capital that needs to be invested in a selection of possible assets, each of them with a unknown return rate , . Let be the vector whose -th component describes the fraction of the capital invested in asset . The return rate vector can be modelled by a multivariate Gaussian distribution with mean and covariance . Assume there is also a risk-free asset with guaranteed return rate and let the amount invested in that asset. We want to determine the portfolio that maximizes the expected return , which in view of our assumptions rewrites as .
Additionally, we include a loss risk chance constraint of the form
Thanks to the assumption that is multivariate Gaussian, this chance constraint can be equivalently rewritten as
which the theory guarantees to be a convex constraint if . The resulting portfolio optimization problem written as a SOCP is
We now implement as a Pyomo model and solve it for , , , the given vector and semi-definite positive covariance matrix .