Another alternative is the global minimum variance (GMV) portfolio, which prioritizes the minimization of risk. It is shown in the efficient frontier figure and can be calculated as follows by minimizing the portfolio standard deviation using the mean-variance framework:
def min_vol(mean_ret, cov, short=True):
return minimize(fun=portfolio_std,
x0=x0,
args=(mean_ret, cov),
method='SLSQP',
bounds=bounds = ((-1 if short else 0, 1),) *
n_assets,
constraints=weight_constraint,
options={'tol': 1e-10, 'maxiter': 1e4})
The corresponding min. volatility portfolio lies on the efficient frontier as shown above.