How to approach a optimization problem from experimental data
Afficher commentaires plus anciens
Hello everyone,
I have acquired values for matrix C(~5000, ~20), through experiments. I believe that the data that I have acquired can be explained by matrix multiplication. In other words A*B=C. Size of A(~5000, ~5) and B(~5,~20). I would like to find the values for the elements in A and B that “best” could explain C. That is the main goal.
I formulated this as an optimization problem: Min sum(sum(((A*B) -C).^2)). There is some linear constraints on elements in B and lower and upper bounds for elements in A and B. I have used the sym toolbox to generate jacobian and hessian for a smaller problem and it works fine. But for a problem of this size the computational time is long. Even when calculating jacobian and hessian using multiple cores. And calculating jacobian and hessian in this way may not be the best option as the hessian is kind of sparse? I am not sure what algorithm would be the best to solve this problem (have used interior-point this far). So suggestion about that is more than welcome. I have used GlobalSearch to try to find the “best” solution.
Is there a better way of finding the values for A and B that explains C? If there is any better way of doing this (objective function, algorithm, you name it) that is less computationally heavy or gives better results, please tell me.
Réponses (1)
Maybe you should show what the sym toolbox gave you for the real problem size. But the expressions for the gradient and Hessian should have a really simple matrix form for this problem - easy to develop by hand without the sym toolbox and very quick to evaluate. For example, the gradients with respect to A and B are
gradient_wrt_A = (A*B-C)*B.';
gradient_wrt_B = A.'(A*B-C);
2 commentaires
Niklas handin
le 10 Juil 2018
But isn’t it missing a factor 2?
Yes, I guess so, although it would be more traditional for you to write your objective function as
f(A,B)=0.5*norm(A*B-C,'fro')^2,
in which case the factor of 2 in the gradient goes away.
Catégories
En savoir plus sur Choose a Solver dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!