Nonlinear Least Squares with Linear Equality

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

Respuestas (1)

Walter Roberson
Walter Roberson el 19 de Oct. de 2015

0 votos

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.

2 comentarios

Kai Chung
Kai Chung el 19 de Oct. de 2015
Thank you, managed to get it to work with fmincon. I'll have to document the methods I used in a report. My draft report mentioned using levenberg marquardt algorithm, but I suppose this is no longer the case. Would you have any idea what this uses? Is it still least squares?
Walter Roberson
Walter Roberson el 19 de Oct. de 2015
The default if you do not specify options is Interior Point, which is described in more detail here

Iniciar sesión para comentar.

Preguntada:

el 18 de Oct. de 2015

Comentada:

el 19 de Oct. de 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by