python - How to minimize matrix w with given equation and conditions? -


w 3*1 matrix , want minimize (w'seccovw), given w'*secmu = 6.5, w'*1 = 1. thank you!

import pandas pd import numpy np scipy.linalg import solve scipy import optimize  seccov = np.matrix('1 2 3, 4 5 6, 7 8 9') secmu = np.matrix('1.1 1.2 1.3').t  def minfunc (w, cov):     return w.t*cov*w 


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -