problem using fminsearch, as parameters that I want to optimize is not input for the handle function
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
What if my model is composited by many subfunctions, and the handle function I am going to use in fminsearch doesn't include the parameters I want to optimize?
For example:
handle function is RMSD(prediction, experiment)
but the parameters I want to optimize is lambda1 and lambda2 which is in the mainfunction where RMSD is called?
How should I write the fminsearch then?
so far i write
[optimal,rmsdmin,exitflag,optimaloutput]=fminsearch(RMSD,@mainfunction,optimal0);
doesn't work
0 commentaires
Réponses (2)
Yogananda Jeppu
le 11 Nov 2017
I am not sure how to do this. I have been using global in my function and optimizing using fminsearch (fmins before). It always works for me - though not a very elegant solution. My take has been I want the optimized solution not the code!
0 commentaires
Alan Weiss
le 13 Nov 2017
This is a question of thinking deliberately. If I understand you correctly, you want to find the control variable lambda = (lambda(1),lambda(2)) that gives the lowest value of RMSD. But RMSD does not depend explicitly on lambda.
Here is where deliberate thinking comes in. fminsearch wants a function that accepts lambda and gives the value of RMSD. If you think about it, you should realize that is exactly what you want, too: the value of RMSD for a given value of lambda. Either you can compute these values or you cannot. If you can compute them, then think about how you do it, and write a MATLAB function that takes a value lambda and returns the RMSD value (this function may well call RMSD).
Alan Weiss
MATLAB mathematical toolbox documentation
0 commentaires
Voir également
Catégories
En savoir plus sur Surrogate Optimization dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!