Optimization

Maximum-likelihood and Bayesian parameter estimation

https://books.google.com/books?id=F62wBgAAQBAJ&pg=PA85&lpg=PA85&dq=maximize+modularity+matlab&source=bl&ots=Khc3s2L7Wd&sig=ACfU3U3m9u63SjCBGvXByVmZ7krpXgN8qg&hl=en&sa=X&ved=2ahUKEwihtsyc-ZfkAhVRnq0KHRmTCmc4HhDoATABegQICRAB#v=onepage&q=maximize%20modularity%20matlab&f=false

Doing a PCA using an optimization

The thing about Optimization is that there are different methods to solve a problem, some of which can require extensive computation.  Your solution, given the constraints for B, is to use fmincon. Start by creating a file for the non-linear constraints: