def min_volatility(self):
if not self.w:<EOL><INDENT>self.solve()<EOL><DEDENT>var = []<EOL>for w in self.w:<EOL><INDENT>a = np.dot(np.dot(w.T, self.cov_matrix), w)<EOL>var.append(a)<EOL><DEDENT>self.weights = self.w[var.index(min(var))].reshape((self.n_assets,))<EOL>return dict(zip(self.tickers, self.weights))<EOL>
Get the minimum variance solution