Nonlinear Least Squares with Linear Equality
Ältere Kommentare anzeigen
Hi,
I have a nonlinear least squares problem I need to solve, but I have a linear equality constraint on my parameters: a + b + c = 1.
I have been using lsqnonlin so far, is it possible to have constraints?
I tried substituting c = 1 - a - b, but it does not hold the equality because say if lsqnonlin arrives at the solution a = 0.7 and b = 0.7, a + b + c ~= 1.
Thanks
Antworten (1)
Walter Roberson
am 19 Okt. 2015
0 Stimmen
lsqnonlin() and lsqcurvefit() can only have upper and lower bounds. lsqlin() allows linear constraints but it is only linear rather than non-linear
So... what you have to do is transform the objective to one that computes the sum of squares directly and use fmincon() to minimize the residual.
Kategorien
Mehr zu Linear Least Squares finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!