<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265717</link>
    <title>MATLAB Central Newsreader - Linear fit forcing zerointercept: How to compute confidence interval</title>
    <description>Feed for thread: Linear fit forcing zerointercept: How to compute confidence interval</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>Thu, 12 Nov 2009 22:04:02 -0500</pubDate>
      <title>Linear fit forcing zerointercept: How to compute confidence interval</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265717#694361</link>
      <author>Rafael</author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
I was using polyfit to fit a line in my data. The nice thing about doing that is that I can actually get the 95% confidence interval as well when I use the polyconf function.&lt;br&gt;
&lt;br&gt;
[p,S] = polyfit(x,y,1);&lt;br&gt;
[Y,DELTA] = polyconf(p,x,S);&lt;br&gt;
&lt;br&gt;
Now, I need to fit a line but force the intercept to be zero. My understanding is that polyfit cannot be used, and I heard in some of the posts that a simple equation like X\Y will give me the slope. polyconf needs the S variable calculated in polyfit to generate the confidence interval DELTA. Is there any way I can generate this same variable for the new linear fit X\Y or perhaps another way to compute confidence intervals in this case?&lt;br&gt;
&lt;br&gt;
Thank you,</description>
    </item>
    <item>
      <pubDate>Thu, 12 Nov 2009 23:06:08 -0500</pubDate>
      <title>Re: Linear fit forcing zerointercept: How to compute confidence </title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265717#694380</link>
      <author>jrenfree</author>
      <description>On Nov 12, 2:04&#160;pm, &quot;Rafael &quot; &amp;lt;roso...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; Hi,&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; I was using polyfit to fit a line in my data. The nice thing about doing that is that I can actually get the 95% confidence interval as well when I use the polyconf function.&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; [p,S] = polyfit(x,y,1);&lt;br&gt;
&amp;gt; [Y,DELTA] = polyconf(p,x,S);&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Now, I need to fit a line but force the intercept to be zero. My understanding is that polyfit cannot be used, and I heard in some of the posts that a simple equation like X\Y will give me the slope. polyconf needs the S variable calculated in polyfit to generate the confidence interval DELTA. Is there any way I can generate this same variable for the new linear fit X\Y or perhaps another way to compute confidence intervals in this case?&lt;br&gt;
&amp;gt;&lt;br&gt;
&amp;gt; Thank you,&lt;br&gt;
&lt;br&gt;
&lt;a href=&quot;http://www.mathworks.com/support/solutions/en/data/1-12BBUC/index.html?product=OP&amp;solution=1-12BBUC&quot;&gt;http://www.mathworks.com/support/solutions/en/data/1-12BBUC/index.html?product=OP&amp;solution=1-12BBUC&lt;/a&gt;</description>
    </item>
    <item>
      <pubDate>Fri, 13 Nov 2009 00:07:01 -0500</pubDate>
      <title>Re: Linear fit forcing zerointercept: How to compute confidence</title>
      <link>http://www.mathworks.com/matlabcentral/newsreader/view_thread/265717#694394</link>
      <author>Rafael</author>
      <description>Hi,&lt;br&gt;
&lt;br&gt;
Thanks for your reply, but I don't think this will actually solve my problem. As I said, I can compute the slope Y = aX by doing &quot;slope = X\Y&quot;. That only works when forcing intercept to be (0,0) (my case). Perhaps for intercept different fro (0,0), the link seems to be very helpful. What I would like to do is how to compute the confidence interval that I used to do with polyfit/polyconf functions when I did not have the constraint of zero intercept.&lt;br&gt;
&lt;br&gt;
From help polyfit:&lt;br&gt;
...&lt;br&gt;
[p,S] = polyfit(x,y,n)&lt;br&gt;
...&lt;br&gt;
structure S for use with polyval to obtain error estimates or predictions. Structure S contains fields R, df, and normr, for the triangular factor from a QR decomposition of the Vandermonde matrix of X, the degrees of freedom, and the norm of the residuals, respectively...&lt;br&gt;
&lt;br&gt;
[y,delta] = polyval(p,x,S)&lt;br&gt;
&lt;br&gt;
Thank you,&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
jrenfree &amp;lt;jrenfree@gmail.com&amp;gt; wrote in message &amp;lt;fd920462-481c-4e9e-9c7a-201a5a209cf7@u36g2000prn.googlegroups.com&amp;gt;...&lt;br&gt;
&amp;gt; On Nov 12, 2:04?pm, &quot;Rafael &quot; &amp;lt;roso...@gmail.com&amp;gt; wrote:&lt;br&gt;
&amp;gt; &amp;gt; Hi,&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; I was using polyfit to fit a line in my data. The nice thing about doing that is that I can actually get the 95% confidence interval as well when I use the polyconf function.&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; [p,S] = polyfit(x,y,1);&lt;br&gt;
&amp;gt; &amp;gt; [Y,DELTA] = polyconf(p,x,S);&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Now, I need to fit a line but force the intercept to be zero. My understanding is that polyfit cannot be used, and I heard in some of the posts that a simple equation like X\Y will give me the slope. polyconf needs the S variable calculated in polyfit to generate the confidence interval DELTA. Is there any way I can generate this same variable for the new linear fit X\Y or perhaps another way to compute confidence intervals in this case?&lt;br&gt;
&amp;gt; &amp;gt;&lt;br&gt;
&amp;gt; &amp;gt; Thank you,&lt;br&gt;
&amp;gt; &lt;br&gt;
&amp;gt; &lt;a href=&quot;http://www.mathworks.com/support/solutions/en/data/1-12BBUC/index.html?product=OP&amp;solution=1-12BBUC&quot;&gt;http://www.mathworks.com/support/solutions/en/data/1-12BBUC/index.html?product=OP&amp;solution=1-12BBUC&lt;/a&gt;</description>
    </item>
  </channel>
</rss>

