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

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

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -