<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.ch/matlabcentral/newsreader/view_thread/246620</link>
    <title>MATLAB Central Newsreader - linear regression, X\Y vs. Y\X</title>
    <description>Feed for thread: linear regression, X\Y vs. Y\X</description>
    <language>en-us</language>
    <copyright>&amp;copy;1994-2013 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.ch/images/membrane_icon.gif</url>
    </image>
    <item>
      <pubDate>Fri, 13 Mar 2009 18:20:18 +0000</pubDate>
      <title>linear regression, X\Y vs. Y\X</title>
      <link>http://www.mathworks.ch/matlabcentral/newsreader/view_thread/246620#634690</link>
      <author>KC </author>
      <description>I can't figure out why X\Y is not reciprocal of Y\X, given the following: &lt;br&gt;
&lt;br&gt;
X = [1 2 4 5 7 9 11 13 14 16]'; Y = [101 105 109 112 117 116 122 123 129 130]';&lt;br&gt;
X\Y&lt;br&gt;
ans =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;10.8900&lt;br&gt;
Y\X&lt;br&gt;
ans =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0.0733&lt;br&gt;
1/(Y\X)&lt;br&gt;
ans =&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;13.6391&lt;br&gt;
I am not sure I know why. I'd appreciate your explanations.&lt;br&gt;
Thanks.</description>
    </item>
    <item>
      <pubDate>Fri, 13 Mar 2009 18:42:02 +0000</pubDate>
      <title>Re: linear regression, X\Y vs. Y\X</title>
      <link>http://www.mathworks.ch/matlabcentral/newsreader/view_thread/246620#634696</link>
      <author>Bruno Luong</author>
      <description>"KC " &amp;lt;kctung75034@gmail.com&amp;gt; wrote in message &amp;lt;gpe852$lsc$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I can't figure out why X\Y is not reciprocal of Y\X, given the following: &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; X = [1 2 4 5 7 9 11 13 14 16]'; Y = [101 105 109 112 117 116 122 123 129 130]';&lt;br&gt;
&amp;gt; X\Y&lt;br&gt;
&amp;gt; ans =&lt;br&gt;
&amp;gt;    10.8900&lt;br&gt;
&lt;br&gt;
This is least-square on Y, ie, a:=X\Y minimizes norm(Y - a*X) (for all real number a)&lt;br&gt;
&lt;br&gt;
&amp;gt; Y\X&lt;br&gt;
&amp;gt; ans =&lt;br&gt;
&amp;gt;     0.0733&lt;br&gt;
&lt;br&gt;
This is least-square on X, ie, b:=Y\X minimizes norm(X - b*Y) (for all real number b)&lt;br&gt;
&lt;br&gt;
Not the same thing.&lt;br&gt;
&lt;br&gt;
% Least square Y&lt;br&gt;
norm(Y-X*a)&lt;br&gt;
norm(Y-X/b) % larger&lt;br&gt;
&lt;br&gt;
% Least square X&lt;br&gt;
norm(Y*b-X)&lt;br&gt;
norm(Y/a-X) % larger&lt;br&gt;
&lt;br&gt;
Bruno</description>
    </item>
    <item>
      <pubDate>Sat, 14 Mar 2009 01:54:00 +0000</pubDate>
      <title>Re: linear regression, X\Y vs. Y\X</title>
      <link>http://www.mathworks.ch/matlabcentral/newsreader/view_thread/246620#634770</link>
      <author>Roger Stafford</author>
      <description>"KC " &amp;lt;kctung75034@gmail.com&amp;gt; wrote in message &amp;lt;gpe852$lsc$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; I can't figure out why X\Y is not reciprocal of Y\X, given the following: &lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; X = [1 2 4 5 7 9 11 13 14 16]'; Y = [101 105 109 112 117 116 122 123 129 130]';&lt;br&gt;
&amp;gt; ........&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;I think what is bothering you, KC, is why you don't get the same (homogeneous) regression line in the two methods.  If the one answer were the reciprocal of the other, then the two regression lines would be the same line.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;It should interest you to learn that there is only way these lines can be the same, and that is for all the given points to be colinear with some line through the origin; in other words all the x and y coordinates must be proportional.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;The two kinds of regression are based on differing assumptions.  In the one it is assumed that all the errors lie in the x-coordinates, while the other kind assumes that all the errors are in the y-coordinates.  It is therefore not surprising that one will obtain differing approximating lines.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;There is another method using eigenvectors which assumes that both x and y are subject to equal amounts of errors, and this produces yet a third line positioned between the other two.  None of the three lines is the same except when the original data lies strictly along a line through the origin.&lt;br&gt;
&lt;br&gt;
Roger Stafford</description>
    </item>
    <item>
      <pubDate>Wed, 24 Jun 2009 23:07:01 +0000</pubDate>
      <title>Re: linear regression, X\Y vs. Y\X</title>
      <link>http://www.mathworks.ch/matlabcentral/newsreader/view_thread/246620#660300</link>
      <author>shinchan </author>
      <description>Hi Roger,&lt;br&gt;
I would like to know how to solve this using an eigenvectors as you mentioned. Do you mean that the eigenvalue is the constant term that project X to Y, i.e., the proportionality between X and Y? I am not sure how to conceptualize this into a eigenvector problem, or put it in Matlab code. Please help.&lt;br&gt;
Thansk.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
"Roger Stafford" &amp;lt;ellieandrogerxyzzy@mindspring.com.invalid&amp;gt; wrote in message &amp;lt;gpf2no$hp5$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; "KC " &amp;lt;kctung75034@gmail.com&amp;gt; wrote in message &amp;lt;gpe852$lsc$1@fred.mathworks.com&amp;gt;...&lt;br&gt;
&amp;gt; &amp;gt; I can't figure out why X\Y is not reciprocal of Y\X, given the following: &lt;br&gt;
&amp;gt; &amp;gt; &lt;br&gt;
&amp;gt; &amp;gt; X = [1 2 4 5 7 9 11 13 14 16]'; Y = [101 105 109 112 117 116 122 123 129 130]';&lt;br&gt;
&amp;gt; &amp;gt; ........&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   I think what is bothering you, KC, is why you don't get the same (homogeneous) regression line in the two methods.  If the one answer were the reciprocal of the other, then the two regression lines would be the same line.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   It should interest you to learn that there is only way these lines can be the same, and that is for all the given points to be colinear with some line through the origin; in other words all the x and y coordinates must be proportional.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   The two kinds of regression are based on differing assumptions.  In the one it is assumed that all the errors lie in the x-coordinates, while the other kind assumes that all the errors are in the y-coordinates.  It is therefore not surprising that one will obtain differing approximating lines.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt;   There is another method using eigenvectors which assumes that both x and y are subject to equal amounts of errors, and this produces yet a third line positioned between the other two.  None of the three lines is the same except when the original data lies strictly along a line through the origin.&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; Roger Stafford</description>
    </item>
  </channel>
</rss>
