"Santiago Mazuelas" <mazuyo@hotmail.com> wrote in message
<fr6t5q$648$1@fred.mathworks.com>...
> I have a linear regression problem in which the variables
> X,Y,Z are related by
>
> Z=aX+bY+c
>
> but a I have the nonlinear constraint c=a^2+b^2
>
> Anybody can tell me how to solve this problem?
"Miroslav Balda" <balda.nospam@cdm.it.cas.cz> wrote in
message <fr7smj$ql9$1@fred.mathworks.com>...
> "Santiago Mazuelas" <mazuyo@hotmail.com> wrote in message
> <fr6t5q$648$1@fred.mathworks.com>...
> > I have a linear regression problem in which the
variables
> > X,Y,Z are related by
> >
> > Z=aX+bY+c
> >
> > but a I have the nonlinear constraint c=a^2+b^2
> >
> > Anybody can tell me how to solve this problem?
>
> Hi
>
> Try function LMFnlsq
>
> http://www.mathworks.com/matlabcentral/fileexchange/loadFile
.do?objectId=17534&objectType=FILE
>
> to obtain least squares solution by calling
>
> res = @(ab) X*ab(1)+Y*ab(2)+ab(1)^2+ab(2)^2-Z;
> x = LMFnlsq(res,x0);
>
> where x0 is the inoitial guess of the solution, x(1)=a
and
> x(2)=b.
>
> I hope it helps.
>
> Mira
>
>
>
Ok but I want a solution that do not need a initial guess.
I realize that my problem is non linear indeed, but maybe
not too much non linear..
Subject: linear regression with a nonlinear constraint
On 2008-03-12 05:33:01 -0400, "Santiago Mazuelas" <mazuyo@hotmail.com> said:
> Ok but I want a solution that do not need a initial guess.
> I realize that my problem is non linear indeed, but maybe
> not too much non linear..
Are you sure that's what you mean?
All numerical solvers require some sort of initial guess. Even if you
don't specify one, the solver is calculating its own initial guess.
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central.
Read the complete Terms prior to use.