<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165478</link>
    <title>MATLAB Central Newsreader - linear regression with a nonlinear constraint</title>
    <description>Feed for thread: linear regression with a nonlinear constraint</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2012 by MathWorks, Inc.</copyright>
    <webmaster>webmaster@mathworks.com</webmaster>
    <generator>MATLAB Central Newsreader</generator>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <ttl>60</ttl>
    <image>
      <title>MathWorks</title>
      <url>http://www.mathworks.com/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Tue, 11 Mar 2008 21:22:02 -0400</pubDate>
      <title>linear regression with a nonlinear constraint</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165478#420331</link>
      <author>Santiago Mazuelas</author>
      <description>I have a linear regression problem in which the variables &lt;br&gt;
X,Y,Z are related by&lt;br&gt;
&amp;nbsp;&lt;br&gt;
Z=aX+bY+c&lt;br&gt;
&lt;br&gt;
but a I have the nonlinear constraint c=a^2+b^2&lt;br&gt;
&lt;br&gt;
Anybody can tell me how to solve this problem? </description>
    </item>
    <item>
      <pubDate>Wed, 12 Mar 2008 06:20:03 -0400</pubDate>
      <title>Re: linear regression with a nonlinear constraint</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165478#420367</link>
      <author>Miroslav Balda</author>
      <description>&quot;Santiago Mazuelas&quot; &amp;lt;mazuyo@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;lt;fr6t5q$648$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I have a linear regression problem in which the variables &lt;br&gt;
&amp;gt; X,Y,Z are related by&lt;br&gt;
&amp;gt;  &lt;br&gt;
&amp;gt; Z=aX+bY+c&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; but a I have the nonlinear constraint c=a^2+b^2&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Anybody can tell me how to solve this problem? &lt;br&gt;
&lt;br&gt;
Hi&lt;br&gt;
&lt;br&gt;
Try function LMFnlsq&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=17534&amp;objectType=FILE&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=17534&amp;objectType=FILE&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
to obtain least squares solution by calling&lt;br&gt;
&lt;br&gt;
res = @(ab) X*ab(1)+Y*ab(2)+ab(1)^2+ab(2)^2-Z; &lt;br&gt;
x = LMFnlsq(res,x0);&lt;br&gt;
&lt;br&gt;
where x0 is the inoitial guess of the solution, x(1)=a  and&lt;br&gt;
x(2)=b.&lt;br&gt;
&lt;br&gt;
I hope it helps.&lt;br&gt;
&lt;br&gt;
Mira</description>
    </item>
    <item>
      <pubDate>Wed, 12 Mar 2008 09:33:01 -0400</pubDate>
      <title>Re: linear regression with a nonlinear constraint</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165478#420393</link>
      <author>Santiago Mazuelas</author>
      <description>&quot;Miroslav Balda&quot; &amp;lt;balda.nospam@cdm.it.cas.cz&amp;gt; wrote in &lt;br&gt;
message &amp;lt;fr7smj$ql9$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &quot;Santiago Mazuelas&quot; &amp;lt;mazuyo@hotmail.com&amp;gt; wrote in message&lt;br&gt;
&amp;gt; &amp;lt;fr6t5q$648$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I have a linear regression problem in which the &lt;br&gt;
variables &lt;br&gt;
&amp;gt; &amp;gt; X,Y,Z are related by&lt;br&gt;
&amp;gt; &amp;gt;  &lt;br&gt;
&amp;gt; &amp;gt; Z=aX+bY+c&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; but a I have the nonlinear constraint c=a^2+b^2&lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; Anybody can tell me how to solve this problem? &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Hi&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Try function LMFnlsq&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/matlabcentral/fileexchange/loadFile&quot;&gt;http://www.mathworks.com/matlabcentral/fileexchange/loadFile&lt;/a&gt;&lt;br&gt;
.do?objectId=17534&amp;objectType=FILE&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; to obtain least squares solution by calling&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; res = @(ab) X*ab(1)+Y*ab(2)+ab(1)^2+ab(2)^2-Z; &lt;br&gt;
&amp;gt; x = LMFnlsq(res,x0);&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; where x0 is the inoitial guess of the solution, x(1)=a  &lt;br&gt;
and&lt;br&gt;
&amp;gt; x(2)=b.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; I hope it helps.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Mira&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;br&gt;
&lt;br&gt;
Ok but I want a solution that do not need a initial guess. &lt;br&gt;
I realize that my problem is non linear indeed, but maybe &lt;br&gt;
not too much non linear..</description>
    </item>
    <item>
      <pubDate>Wed, 12 Mar 2008 14:29:21 -0400</pubDate>
      <title>Re: linear regression with a nonlinear constraint</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/165478#420464</link>
      <author>Arthur G</author>
      <description>On 2008-03-12 05:33:01 -0400, &quot;Santiago Mazuelas&quot; &amp;lt;mazuyo@hotmail.com&amp;gt; said:&lt;br&gt;
&amp;gt; Ok but I want a solution that do not need a initial guess.&lt;br&gt;
&amp;gt; I realize that my problem is non linear indeed, but maybe&lt;br&gt;
&amp;gt; not too much non linear..&lt;br&gt;
&lt;br&gt;
Are you sure that's what you mean?&lt;br&gt;
&lt;br&gt;
All numerical solvers require some sort of initial guess. Even if you &lt;br&gt;
don't specify one, the solver is calculating its own initial guess.</description>
    </item>
  </channel>
</rss>

