Thread Subject: linear regression with a nonlinear constraint

Subject: linear regression with a nonlinear constraint

From: Santiago Mazuelas

Date: 11 Mar, 2008 21:22:02

Message: 1 of 4

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?

Subject: linear regression with a nonlinear constraint

From: Miroslav Balda

Date: 12 Mar, 2008 06:20:03

Message: 2 of 4

"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



Subject: linear regression with a nonlinear constraint

From: Santiago Mazuelas

Date: 12 Mar, 2008 09:33:01

Message: 3 of 4

"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

From: Arthur G

Date: 12 Mar, 2008 14:29:21

Message: 4 of 4

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.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
linear regression Santiago Mazuelas 12 Mar, 2008 05:35:05
least squares Miroslav Balda 12 Mar, 2008 02:20:23
rssFeed for this Thread

Public Submission Policy

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 Disclaimer prior to use.

Contact us at files@mathworks.com