<?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: LOESS Smoothing in Excel</title>
	<atom:link href="http://peltiertech.com/WordPress/loess-smoothing-in-excel/feed/" rel="self" type="application/rss+xml" />
	<link>http://peltiertech.com/WordPress/loess-smoothing-in-excel/</link>
	<description>Peltier Tech Excel Charts and Programming Blog</description>
	<lastBuildDate>Thu, 11 Mar 2010 22:03:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/loess-smoothing-in-excel/comment-page-1/#comment-26188</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Sat, 30 Jan 2010 20:37:55 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1659#comment-26188</guid>
		<description>&quot;I would say that LOESS fitting is really a choice for sparse data series.&quot;
The literature indicates that loess is better for heavily populated data sets.

Do your moving averages weight the data prior to averaging?

The ReDim statements and the iMin and iMax statements can all be taken out of the loop. Perhaps the original programmer initially had them inside the loop before I saw the code, and then I never put them in front of the loop.</description>
		<content:encoded><![CDATA[<p>&#8220;I would say that LOESS fitting is really a choice for sparse data series.&#8221;<br />
The literature indicates that loess is better for heavily populated data sets.</p>
<p>Do your moving averages weight the data prior to averaging?</p>
<p>The ReDim statements and the iMin and iMax statements can all be taken out of the loop. Perhaps the original programmer initially had them inside the loop before I saw the code, and then I never put them in front of the loop.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tom</title>
		<link>http://peltiertech.com/WordPress/loess-smoothing-in-excel/comment-page-1/#comment-26185</link>
		<dc:creator>tom</dc:creator>
		<pubDate>Sat, 30 Jan 2010 18:57:37 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1659#comment-26185</guid>
		<description>&gt;The apparent lag may be pronounced near the ends of the data set
That&#039;s what I know from moving average fitting. 
It was designed to fit a time series where mostly the newest fit is the interesting one.

From the VBA code I would say that LOESS fitting is really a choice for sparse data series. Time series make only sense if there are gaps in between. I used a similar technique already on time series in Excel like in your example.

If the distances are always the same between two X points, then the algorithm is just too general and consuming. My experience is that you always find a moving average that is as almost as good fitting as the moving regression window.

By the way: Why did you use Redim in a for-loop? There is another redim going over 
all available data. One second Redim before the for would take more memory and save
time.</description>
		<content:encoded><![CDATA[<p>&gt;The apparent lag may be pronounced near the ends of the data set<br />
That&#8217;s what I know from moving average fitting.<br />
It was designed to fit a time series where mostly the newest fit is the interesting one.</p>
<p>From the VBA code I would say that LOESS fitting is really a choice for sparse data series. Time series make only sense if there are gaps in between. I used a similar technique already on time series in Excel like in your example.</p>
<p>If the distances are always the same between two X points, then the algorithm is just too general and consuming. My experience is that you always find a moving average that is as almost as good fitting as the moving regression window.</p>
<p>By the way: Why did you use Redim in a for-loop? There is another redim going over<br />
all available data. One second Redim before the for would take more memory and save<br />
time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/loess-smoothing-in-excel/comment-page-1/#comment-26170</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Sat, 30 Jan 2010 14:06:13 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1659#comment-26170</guid>
		<description>Tom -

A comparison of moving average to loess would make more sense if the calculated moving average was plotted in the middle of the data for the moving average, but conventionally this is not done. Loess never used this convention.

Where I have noted an apparent lag in loess is in cases where the variation in the raw data is not symmetric, for example, when an increase is followed by a decrease which is much more or less steep. Changing the number of points in the moving regression may reduce the apparent lag. The apparent lag may be pronounced near the ends of the data set, where the regression consists of substantially more points on one side of the X value for the loess calculation.</description>
		<content:encoded><![CDATA[<p>Tom -</p>
<p>A comparison of moving average to loess would make more sense if the calculated moving average was plotted in the middle of the data for the moving average, but conventionally this is not done. Loess never used this convention.</p>
<p>Where I have noted an apparent lag in loess is in cases where the variation in the raw data is not symmetric, for example, when an increase is followed by a decrease which is much more or less steep. Changing the number of points in the moving regression may reduce the apparent lag. The apparent lag may be pronounced near the ends of the data set, where the regression consists of substantially more points on one side of the X value for the loess calculation.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tom</title>
		<link>http://peltiertech.com/WordPress/loess-smoothing-in-excel/comment-page-1/#comment-26144</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Fri, 29 Jan 2010 22:16:58 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1659#comment-26144</guid>
		<description>I guess your page explains LOESS more practical than all the rocket science pages I tried before I came here.

You have a big glitch in your moving average example. MA always get a lag of n/2 points. The reason is that the MA is the 50% trend value of one linear regression of n x,y points. Both smoothing filters are comparable in the X axis if the MA is calculated from the n/2 days in the future. You would use the MA with OFFSET and AVG functions then and not take the diagram&#039;s moving average.
However, some example charts indicate lags in the LOESS .. am I wrong?

By the way, I always was and am a big fan of your Excel experiences.
Big timesavers for me.</description>
		<content:encoded><![CDATA[<p>I guess your page explains LOESS more practical than all the rocket science pages I tried before I came here.</p>
<p>You have a big glitch in your moving average example. MA always get a lag of n/2 points. The reason is that the MA is the 50% trend value of one linear regression of n x,y points. Both smoothing filters are comparable in the X axis if the MA is calculated from the n/2 days in the future. You would use the MA with OFFSET and AVG functions then and not take the diagram&#8217;s moving average.<br />
However, some example charts indicate lags in the LOESS .. am I wrong?</p>
<p>By the way, I always was and am a big fan of your Excel experiences.<br />
Big timesavers for me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Don</title>
		<link>http://peltiertech.com/WordPress/loess-smoothing-in-excel/comment-page-1/#comment-20229</link>
		<dc:creator>Don</dc:creator>
		<pubDate>Tue, 06 Oct 2009 23:01:55 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1659#comment-20229</guid>
		<description>In MathCAD 14, you create a 2-column matrix of the data and set the first column = X and the second column = Y.  I named my matrix NIST.  Then enter the following:

NIST(x):=interp(loess(X,Y,.5),X,Y,x)  

where x was set as a range variable x:=0,0.1,..20

This creates a function NIST(x) that you can plot versus the range variable x

Here is the MathCAD explanation for the two built-in functions &#039;interp&#039; &amp; &#039;loess&#039;:

loess(vx, vy, span)  Returns a vector which interp uses to find a set of second-order polynomials that best fit the neighborhood of x and y data values in vx and vy in the least-squares sense. The size of the neighborhood is controlled by span. 

interp(vs, vx, vy, x)  Returns the interpolated y-value corresponding to x using the output vector vs from loess.</description>
		<content:encoded><![CDATA[<p>In MathCAD 14, you create a 2-column matrix of the data and set the first column = X and the second column = Y.  I named my matrix NIST.  Then enter the following:</p>
<p>NIST(x):=interp(loess(X,Y,.5),X,Y,x)  </p>
<p>where x was set as a range variable x:=0,0.1,..20</p>
<p>This creates a function NIST(x) that you can plot versus the range variable x</p>
<p>Here is the MathCAD explanation for the two built-in functions &#8216;interp&#8217; &amp; &#8216;loess&#8217;:</p>
<p>loess(vx, vy, span)  Returns a vector which interp uses to find a set of second-order polynomials that best fit the neighborhood of x and y data values in vx and vy in the least-squares sense. The size of the neighborhood is controlled by span. </p>
<p>interp(vs, vx, vy, x)  Returns the interpolated y-value corresponding to x using the output vector vs from loess.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tian</title>
		<link>http://peltiertech.com/WordPress/loess-smoothing-in-excel/comment-page-1/#comment-19726</link>
		<dc:creator>Tian</dc:creator>
		<pubDate>Fri, 25 Sep 2009 13:40:40 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1659#comment-19726</guid>
		<description>Now I understand what you mean. Thank you for clarifying.</description>
		<content:encoded><![CDATA[<p>Now I understand what you mean. Thank you for clarifying.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/loess-smoothing-in-excel/comment-page-1/#comment-19677</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Thu, 24 Sep 2009 22:23:43 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1659#comment-19677</guid>
		<description>Your original output is the result of LOESS calculation using a 7 point moving regression, using X and Y input as inputs and X output as the X output.

Your new output is the result of LOESS calculation using a 7 point moving regression, using X and Y input as inputs and X &lt;strong&gt;input&lt;/strong&gt; as the X output.</description>
		<content:encoded><![CDATA[<p>Your original output is the result of LOESS calculation using a 7 point moving regression, using X and Y input as inputs and X output as the X output.</p>
<p>Your new output is the result of LOESS calculation using a 7 point moving regression, using X and Y input as inputs and X <strong>input</strong> as the X output.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tian</title>
		<link>http://peltiertech.com/WordPress/loess-smoothing-in-excel/comment-page-1/#comment-19666</link>
		<dc:creator>Tian</dc:creator>
		<pubDate>Thu, 24 Sep 2009 17:17:46 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1659#comment-19666</guid>
		<description>Jon,

Please see the difference of the output:

X input	Y input 		X output	original output	new output
0.55782	18.63654		0	-13.07212037	20.59304051
2.021727	103.4965		1	47.06914445	107.1603064
2.577325	150.3539		2	105.8974689	139.7673806
3.414029	190.5103		3	159.6924955	174.2630716
4.301408	208.7012		4	196.8626739	207.2333938
4.744839	213.7114		5	219.0115635	216.6616039
5.107378	228.4935		6	227.6417493	220.5444981
6.541166	233.5539		7	230.2534309	229.8606994
6.721618	234.5505		8	227.0376643	229.8347242
7.260058	223.8923		9	221.246659	229.4301269
8.133587	227.6834		10	202.9876659	226.6044626
9.122438	223.9198		11	187.8518139	220.3904231
11.92967	168.02		12	170.6711911	172.3479193
12.37977	164.9575		13	162.210816	163.8416617
13.27286	152.6111		14	160.7756941	161.8489846
14.27675	160.7874		15	159.7155843	160.3350921
15.3731	168.5557		16	161.0838629	160.1920102
15.64766	152.4266		17	194.5740586	161.0555463
18.56054	221.707		18	215.4190384	227.3399984
18.58664	222.6904		19	236.7904956	227.8985782
18.75728	243.1883</description>
		<content:encoded><![CDATA[<p>Jon,</p>
<p>Please see the difference of the output:</p>
<p>X input	Y input 		X output	original output	new output<br />
0.55782	18.63654		0	-13.07212037	20.59304051<br />
2.021727	103.4965		1	47.06914445	107.1603064<br />
2.577325	150.3539		2	105.8974689	139.7673806<br />
3.414029	190.5103		3	159.6924955	174.2630716<br />
4.301408	208.7012		4	196.8626739	207.2333938<br />
4.744839	213.7114		5	219.0115635	216.6616039<br />
5.107378	228.4935		6	227.6417493	220.5444981<br />
6.541166	233.5539		7	230.2534309	229.8606994<br />
6.721618	234.5505		8	227.0376643	229.8347242<br />
7.260058	223.8923		9	221.246659	229.4301269<br />
8.133587	227.6834		10	202.9876659	226.6044626<br />
9.122438	223.9198		11	187.8518139	220.3904231<br />
11.92967	168.02		12	170.6711911	172.3479193<br />
12.37977	164.9575		13	162.210816	163.8416617<br />
13.27286	152.6111		14	160.7756941	161.8489846<br />
14.27675	160.7874		15	159.7155843	160.3350921<br />
15.3731	168.5557		16	161.0838629	160.1920102<br />
15.64766	152.4266		17	194.5740586	161.0555463<br />
18.56054	221.707		18	215.4190384	227.3399984<br />
18.58664	222.6904		19	236.7904956	227.8985782<br />
18.75728	243.1883</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jon Peltier</title>
		<link>http://peltiertech.com/WordPress/loess-smoothing-in-excel/comment-page-1/#comment-19663</link>
		<dc:creator>Jon Peltier</dc:creator>
		<pubDate>Thu, 24 Sep 2009 16:58:41 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1659#comment-19663</guid>
		<description>Tian -

The line of code works fine in VBA, which assigns the values in a range to a 1-based array. You have to adjust the syntax to use the code in C++.</description>
		<content:encoded><![CDATA[<p>Tian -</p>
<p>The line of code works fine in VBA, which assigns the values in a range to a 1-based array. You have to adjust the syntax to use the code in C++.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tian</title>
		<link>http://peltiertech.com/WordPress/loess-smoothing-in-excel/comment-page-1/#comment-19661</link>
		<dc:creator>Tian</dc:creator>
		<pubDate>Thu, 24 Sep 2009 16:38:23 +0000</pubDate>
		<guid isPermaLink="false">http://peltiertech.com/WordPress/?p=1659#comment-19661</guid>
		<description>Hi Jon,

Thank you for the nice code. It helped me easily added a function to a C++ App. There is a small bug you might not notice. The assignment for xNow should be:

xNow = X(xDomain(iPoint, 1) + 1, 1)

instead of:

xNow = xDomain(iPoint, 1) 

Thank you,</description>
		<content:encoded><![CDATA[<p>Hi Jon,</p>
<p>Thank you for the nice code. It helped me easily added a function to a C++ App. There is a small bug you might not notice. The assignment for xNow should be:</p>
<p>xNow = X(xDomain(iPoint, 1) + 1, 1)</p>
<p>instead of:</p>
<p>xNow = xDomain(iPoint, 1) </p>
<p>Thank you,</p>
]]></content:encoded>
	</item>
</channel>
</rss>
