Guest User

Untitled

a guest
Mar 19th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. def objective(x):
  2. Q = np.asmatrix(DF.cov()) # Covariance matrix
  3. x = np.asmatrix(x)
  4. return x.transpose() * Q * x
  5.  
  6. minimize(objective, x0, method='Nelder-Mead',options={'xtol': 1e-6, 'disp': True})
  7.  
  8. def der_objective(x):
  9. Q = np.asmatrix(DF.cov()) # Covariance matrix
  10. x = np.asmatrix(x)
  11. return Q * x
Add Comment
Please, Sign In to add comment