<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Straight line fit using least squares estimate</title>
	<atom:link href="http://www.dsplog.com/2007/07/15/straight-line-fit-using-least-squares-estimate/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dsplog.com/2007/07/15/straight-line-fit-using-least-squares-estimate/</link>
	<description>Signal Processing for Communication</description>
	<lastBuildDate>Wed, 08 Sep 2010 01:06:58 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Krishna Pillai</title>
		<link>http://www.dsplog.com/2007/07/15/straight-line-fit-using-least-squares-estimate/#comment-309</link>
		<dc:creator>Krishna Pillai</dc:creator>
		<pubDate>Sun, 18 May 2008 10:18:08 +0000</pubDate>
		<guid isPermaLink="false">http://www.dsplog.com/2007/07/15/straight-line-fit-using-least-squares-estimate/#comment-309</guid>
		<description>@Sajith: Is this a homework assignment? In general, I prefer not to solve homework assignments, rather help you towards the solution. You can formulate the information in the least square matrix formultion explained in the post. 

Year = [1971 1976 1977 1978 1979 1980 1981 1982]
Sales = [6.7 5.3 4.3 6.1 5.6 7.9 5.8 6.1]
X = [Year&#039; ones(8,1)]
Y = Sales.&#039;

Once you have done that, then solution for slope and the constant is obtained by the leastsquares equation.
alpha = inv(X&#039;*X)*X&#039;*Y

Once you have the slope and constant, you can find the y-value (sales) for any x-value (year)

Hope this helps.</description>
		<content:encoded><![CDATA[<p>@Sajith: Is this a homework assignment? In general, I prefer not to solve homework assignments, rather help you towards the solution. You can formulate the information in the least square matrix formultion explained in the post. </p>
<p>Year = [1971 1976 1977 1978 1979 1980 1981 1982]<br />
Sales = [6.7 5.3 4.3 6.1 5.6 7.9 5.8 6.1]<br />
X = [Year' ones(8,1)]<br />
Y = Sales.&#8217;</p>
<p>Once you have done that, then solution for slope and the constant is obtained by the leastsquares equation.<br />
alpha = inv(X&#8217;*X)*X&#8217;*Y</p>
<p>Once you have the slope and constant, you can find the y-value (sales) for any x-value (year)</p>
<p>Hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sajith</title>
		<link>http://www.dsplog.com/2007/07/15/straight-line-fit-using-least-squares-estimate/#comment-303</link>
		<dc:creator>Sajith</dc:creator>
		<pubDate>Sat, 17 May 2008 20:17:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.dsplog.com/2007/07/15/straight-line-fit-using-least-squares-estimate/#comment-303</guid>
		<description>From the Data given below fit a straight line trend by the methord if least square and also estimate the sales for the year 1984.

Year 1971 1976	1977	1978	1979	1980	1981	1982
Sales 6.7  5.3	 4.3	6.1	5.6	7.9	5.8	 6.1</description>
		<content:encoded><![CDATA[<p>From the Data given below fit a straight line trend by the methord if least square and also estimate the sales for the year 1984.</p>
<p>Year 1971 1976	1977	1978	1979	1980	1981	1982<br />
Sales 6.7  5.3	 4.3	6.1	5.6	7.9	5.8	 6.1</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Krishna</title>
		<link>http://www.dsplog.com/2007/07/15/straight-line-fit-using-least-squares-estimate/#comment-5</link>
		<dc:creator>Krishna</dc:creator>
		<pubDate>Tue, 17 Jul 2007 15:15:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dsplog.com/2007/07/15/straight-line-fit-using-least-squares-estimate/#comment-5</guid>
		<description>No special reason, except that when does this way, I have a reasonably clear idea of the underlying operations. Maybe helpful if I want to implement. &lt;br/&gt;&lt;br/&gt;For the example above, the least squares solution can be obtained either by using X\Y or pinv(X)*Y. However, when X is rank-deficient, then the code in the post may fail and more &#039;intelligent&#039; operations X\Y or pinv(X)*Y might be needed. &lt;br/&gt;And a quick check showed that \ operator runs faster than pinv() or the code in the post.&lt;br/&gt;&lt;br/&gt;Additionally, a &lt;a HREF=&quot;http://groups.google.com/group/comp.dsp/browse_thread/thread/7ed59548cfeccdfa/05b9fc79913d802e#05b9fc79913d802e&quot; REL=&quot;nofollow&quot;&gt; nice thread in comp.dsp&lt;/a&gt; on this topic maybe interesting.</description>
		<content:encoded><![CDATA[<p>No special reason, except that when does this way, I have a reasonably clear idea of the underlying operations. Maybe helpful if I want to implement. </p>
<p>For the example above, the least squares solution can be obtained either by using X\Y or pinv(X)*Y. However, when X is rank-deficient, then the code in the post may fail and more &#8216;intelligent&#8217; operations X\Y or pinv(X)*Y might be needed. <br />And a quick check showed that \ operator runs faster than pinv() or the code in the post.</p>
<p>Additionally, a <a HREF="http://groups.google.com/group/comp.dsp/browse_thread/thread/7ed59548cfeccdfa/05b9fc79913d802e#05b9fc79913d802e" REL="nofollow"> nice thread in comp.dsp</a> on this topic maybe interesting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Will Dwinnell</title>
		<link>http://www.dsplog.com/2007/07/15/straight-line-fit-using-least-squares-estimate/#comment-4</link>
		<dc:creator>Will Dwinnell</dc:creator>
		<pubDate>Tue, 17 Jul 2007 00:10:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.dsplog.com/2007/07/15/straight-line-fit-using-least-squares-estimate/#comment-4</guid>
		<description>I find it interesting that you used &lt;i&gt;inv&lt;/i&gt; and performed the matrix multiplication to solve this problem.  Do you have a reason for doing it this way, instead of using MATLAB&#039;s backslash operator (as in the linked material, below)?&lt;br/&gt;&lt;br/&gt;&lt;a HREF=&quot;http://matlabdatamining.blogspot.com/2007/04/linear-regression-in-matlab.html&quot; REL=&quot;nofollow&quot;&gt;Linear Regression in MATLAB&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;In curiosity,&lt;br/&gt;Will</description>
		<content:encoded><![CDATA[<p>I find it interesting that you used <i>inv</i> and performed the matrix multiplication to solve this problem.  Do you have a reason for doing it this way, instead of using MATLAB&#8217;s backslash operator (as in the linked material, below)?</p>
<p><a HREF="http://matlabdatamining.blogspot.com/2007/04/linear-regression-in-matlab.html" REL="nofollow">Linear Regression in MATLAB</a></p>
<p>In curiosity,<br />Will</p>
]]></content:encoded>
	</item>
</channel>
</rss>
