Selecting the correct solver for minimization
이전 댓글 표시
Hi,
I'm trying to minimize an expression, which could look something like this: E(x,y) = sum (x_a - x_b)^2 + (y_a - y_b)^2
I guess I should use a least square solver, but how should how should I format the vector valued function? It should not output the squared error and it would be wrong to output the sum of (x_a -x_b) + (y_a - y_b). Should I instead stack the output of (x_a -x_b) and (y_a - y_b)? This will give me double the size of elements summed over. Is this problematic? Or should I use a different solver than least square solver.
The problem I'm trying to solve, is similar to estimating the Essential matrix found in Computer Vision.
Thanks in advance
답변 (1개)
Alan Weiss
2011년 11월 30일
0 개 추천
I'm not sure what your decision variables are, and what variables are outside your control. Perhaps you can use lsqnonlin. http://www.mathworks.com/help/toolbox/optim/ug/lsqnonlin.html In the documentation, x represents a vector of variables that lsqnonlin can modify to search for a minimum. lsqnonlin attempts to minimuze a sum of squares of a vector function f(x).
Read the syntax carefully: lsqnonlin expects a vector function f(x), NOT a sum of squares f(1)^2 + f(2)^2 + ...
댓글 수: 2
Axel
2011년 11월 30일
Steve Grikschat
2011년 12월 13일
It's difficult for me to follow. Can you define what f(1), f(2), etc., are? Perhaps a snippet of code would be helpful.
Also, you have a measure of error that you want to minimize (E(x,y), listed in the original post). Does that match what you get from lsqnonlin?
카테고리
도움말 센터 및 File Exchange에서 Choose a Solver에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!