This code provides an example how to estimate the minimum variance and the minimum Value-at-Risk portfolio. It uses the Mosek software package for which a free personal academic licence can be obtained here.
The file portfolio_optimization.py
downloads the Industry Portfolio data
from Kenneth R. French's website using
the pandas-datareader
package for python.
It then estimates the sample mean and covariance of the returns and
proceeds with estimating the portfolio weights subject to
the required return, either with or without shortselling.