problem using fminsearch, as parameters that I want to optimize is not input for the handle function
조회 수: 4 (최근 30일)
이전 댓글 표시
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
답변 (2개)
Yogananda Jeppu
2017년 11월 11일
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
Alan Weiss
2017년 11월 13일
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
참고 항목
카테고리
Help Center 및 File Exchange에서 Surrogate Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!