<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Spline Smoothing</title>
	<atom:link href="http://climateaudit.org/2009/08/23/spline-smoothing/feed/" rel="self" type="application/rss+xml" />
	<link>http://climateaudit.org/2009/08/23/spline-smoothing/</link>
	<description>by Steve McIntyre</description>
	<lastBuildDate>Fri, 24 May 2013 06:52:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Mark T</title>
		<link>http://climateaudit.org/2009/08/23/spline-smoothing/#comment-192386</link>
		<dc:creator><![CDATA[Mark T]]></dc:creator>
		<pubDate>Sat, 12 Sep 2009 20:35:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=6894#comment-192386</guid>
		<description><![CDATA[Yes, Hu, that&#039;s what I was getting at when I said &quot;all of them.&quot;  I was thinking circular convolution but wrote convolution.  I had intended to write up something similar but got sidetracked.
.
If you want to see how signal processing folks get around the problem (and it is a problem), look up &quot;overlap-add method&quot; over at Wikipedia.  That requires, however, successive FFTs from a long string of data, not just a single record the same length as the FFT.
.
For very large filter applications, the FFT method, even with the added cost of the overlapping, is much, much faster than a convolution.  Implementing brickwall filters is still not recommended because there will still be ringing in the time domain, but other filters can be effectively implemented if it is done properly.
.
Mark]]></description>
		<content:encoded><![CDATA[<p>Yes, Hu, that&#8217;s what I was getting at when I said &#8220;all of them.&#8221;  I was thinking circular convolution but wrote convolution.  I had intended to write up something similar but got sidetracked.<br />
.<br />
If you want to see how signal processing folks get around the problem (and it is a problem), look up &#8220;overlap-add method&#8221; over at Wikipedia.  That requires, however, successive FFTs from a long string of data, not just a single record the same length as the FFT.<br />
.<br />
For very large filter applications, the FFT method, even with the added cost of the overlapping, is much, much faster than a convolution.  Implementing brickwall filters is still not recommended because there will still be ringing in the time domain, but other filters can be effectively implemented if it is done properly.<br />
.<br />
Mark</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hu McCulloch</title>
		<link>http://climateaudit.org/2009/08/23/spline-smoothing/#comment-192385</link>
		<dc:creator><![CDATA[Hu McCulloch]]></dc:creator>
		<pubDate>Fri, 11 Sep 2009 23:05:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=6894#comment-192385</guid>
		<description><![CDATA[I think I now understand why the DFT Brickwall filter illustrated in #136 and used by Paul Clark gives such goofy end-values.

The following shows the Brickwall weights for y(150) with a cutoff of 15, to operate on data vector x(0:300).  This is essentially the same as the graph in #156 above, except now t = 150 is exactly in the center of the sample, since there are now 301 points running from t = 0 to t = 300.  The weights are exactly symmetrical about t = 150, and are a discrete modification of the sinc weights that apply in continuous, unbounded time.



The next graph shows the same thing, but now for y(250).  The weights have just rotated to the right 100 time units, with the weights that have dropped of the right end being added back on the left end.  This rotation occurs because the DFT actually thinks the data is periodic, ie x(301), if observed, would be exactly the same as x(0).  In other words, the DFT brickwall filter is equivalent to using the symmetrical filter for the center point, and then endpadding the the missing &lt;i&gt;last&lt;/i&gt; 100 or whatever points with the &lt;i&gt;first&lt;/i&gt; 100 or whatever points.



With stationary noisy data this wouldn&#039;t have an obvious effect.  However, with uptrending data it creates a cyclic effect as the left and right ends of the data alternately get positive or negative weights.

When you rotate the weights clear to the end , the endpadding becomes even more noticeable with trending data, because now x(0) and x(1), etc are getting almost as much weight as x(300) and x(299), etc!



This is why the first and last smoothed values are almost equal in the first graph in #136 above.

The Brickwall DFT filter&#039;s peculiar other-end-endpadding makes its end properties even stranger than Mann&#039;s double-flip or Rahmstorf&#039;s extrapolative endpadding.  At least they are endpadding with data from the same end of the data series!]]></description>
		<content:encoded><![CDATA[<p>I think I now understand why the DFT Brickwall filter illustrated in #136 and used by Paul Clark gives such goofy end-values.</p>
<p>The following shows the Brickwall weights for y(150) with a cutoff of 15, to operate on data vector x(0:300).  This is essentially the same as the graph in #156 above, except now t = 150 is exactly in the center of the sample, since there are now 301 points running from t = 0 to t = 300.  The weights are exactly symmetrical about t = 150, and are a discrete modification of the sinc weights that apply in continuous, unbounded time.</p>
<p>The next graph shows the same thing, but now for y(250).  The weights have just rotated to the right 100 time units, with the weights that have dropped of the right end being added back on the left end.  This rotation occurs because the DFT actually thinks the data is periodic, ie x(301), if observed, would be exactly the same as x(0).  In other words, the DFT brickwall filter is equivalent to using the symmetrical filter for the center point, and then endpadding the the missing <i>last</i> 100 or whatever points with the <i>first</i> 100 or whatever points.</p>
<p>With stationary noisy data this wouldn&#8217;t have an obvious effect.  However, with uptrending data it creates a cyclic effect as the left and right ends of the data alternately get positive or negative weights.</p>
<p>When you rotate the weights clear to the end , the endpadding becomes even more noticeable with trending data, because now x(0) and x(1), etc are getting almost as much weight as x(300) and x(299), etc!</p>
<p>This is why the first and last smoothed values are almost equal in the first graph in #136 above.</p>
<p>The Brickwall DFT filter&#8217;s peculiar other-end-endpadding makes its end properties even stranger than Mann&#8217;s double-flip or Rahmstorf&#8217;s extrapolative endpadding.  At least they are endpadding with data from the same end of the data series!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sky</title>
		<link>http://climateaudit.org/2009/08/23/spline-smoothing/#comment-192384</link>
		<dc:creator><![CDATA[sky]]></dc:creator>
		<pubDate>Tue, 08 Sep 2009 22:25:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=6894#comment-192384</guid>
		<description><![CDATA[Yep, there is no free lunch in time-series analysis. HP may be linear, but the smoothing is inconsistent, being dependent on record-length.  This also applies to the Fourier composition of any finite data series that some would &quot;filter&quot; by manipulating the F. coefficients.  By contrast, genuine FIR filters always produce the same result over the applicable stretch of record.  End of story.]]></description>
		<content:encoded><![CDATA[<p>Yep, there is no free lunch in time-series analysis. HP may be linear, but the smoothing is inconsistent, being dependent on record-length.  This also applies to the Fourier composition of any finite data series that some would &#8220;filter&#8221; by manipulating the F. coefficients.  By contrast, genuine FIR filters always produce the same result over the applicable stretch of record.  End of story.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John S.</title>
		<link>http://climateaudit.org/2009/08/23/spline-smoothing/#comment-192383</link>
		<dc:creator><![CDATA[John S.]]></dc:creator>
		<pubDate>Tue, 08 Sep 2009 18:20:26 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=6894#comment-192383</guid>
		<description><![CDATA[Re: &lt;a href=&quot;#comment-355487&quot; rel=&quot;nofollow&quot;&gt;Basil (#180)&lt;/a&gt;,

There is a categorical difference between constructed indices and measurable reality.  In the case of surface-station data, physical processes--known and unknown--determine the time history (signal) of temperature at the measurement site.  &quot;Global&quot; indices constructed from highly incomplete geographic coverage of sites are nothing more than statistical samples of the concurrent average temperature troughout the globe.  Such averages, even if known quite completely, do not necessarily conform to the laws of physics, because the dry bulb temperature alone is an inadequate measure of prevailing energy levels.  And in your example of stock market indices, until the advent of index funds, futures and options, the common saying about index values was &quot;you can&#039;t trade on them.&quot;]]></description>
		<content:encoded><![CDATA[<p>Re: <a href="#comment-355487" rel="nofollow">Basil (#180)</a>,</p>
<p>There is a categorical difference between constructed indices and measurable reality.  In the case of surface-station data, physical processes&#8211;known and unknown&#8211;determine the time history (signal) of temperature at the measurement site.  &#8220;Global&#8221; indices constructed from highly incomplete geographic coverage of sites are nothing more than statistical samples of the concurrent average temperature troughout the globe.  Such averages, even if known quite completely, do not necessarily conform to the laws of physics, because the dry bulb temperature alone is an inadequate measure of prevailing energy levels.  And in your example of stock market indices, until the advent of index funds, futures and options, the common saying about index values was &#8220;you can&#8217;t trade on them.&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John S.</title>
		<link>http://climateaudit.org/2009/08/23/spline-smoothing/#comment-192382</link>
		<dc:creator><![CDATA[John S.]]></dc:creator>
		<pubDate>Tue, 08 Sep 2009 17:53:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=6894#comment-192382</guid>
		<description><![CDATA[Re: &lt;a href=&quot;#comment-355469&quot; rel=&quot;nofollow&quot;&gt;Hu McCulloch (#179)&lt;/a&gt;,

Thank you for revealing that HP uses variable weights for a fixed value of the smoothing parameter.  This makes it a linear curve-fitting operation (in contradistiction to proper linear filtering) and renders it unsuitable for scientific work, where the precise effect of data smoothing upon the spectral (or autocorrelation) structure needs to be known for a host of purposes.]]></description>
		<content:encoded><![CDATA[<p>Re: <a href="#comment-355469" rel="nofollow">Hu McCulloch (#179)</a>,</p>
<p>Thank you for revealing that HP uses variable weights for a fixed value of the smoothing parameter.  This makes it a linear curve-fitting operation (in contradistiction to proper linear filtering) and renders it unsuitable for scientific work, where the precise effect of data smoothing upon the spectral (or autocorrelation) structure needs to be known for a host of purposes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hu McCulloch</title>
		<link>http://climateaudit.org/2009/08/23/spline-smoothing/#comment-192381</link>
		<dc:creator><![CDATA[Hu McCulloch]]></dc:creator>
		<pubDate>Tue, 08 Sep 2009 15:41:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=6894#comment-192381</guid>
		<description><![CDATA[RE #179,
Here is the graph of the HP weights for n = 100 and 5 selected y(t) values.

Graphing them all at once as in Fig. 1 in the post creates a visually interesting pattern, but it is hard to see the individual curves.  Unlike the fixed-knot spline, the HP weights have modes that do not oscillate with t.]]></description>
		<content:encoded><![CDATA[<p>RE #179,<br />
Here is the graph of the HP weights for n = 100 and 5 selected y(t) values.</p>
<p>Graphing them all at once as in Fig. 1 in the post creates a visually interesting pattern, but it is hard to see the individual curves.  Unlike the fixed-knot spline, the HP weights have modes that do not oscillate with t.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Basil</title>
		<link>http://climateaudit.org/2009/08/23/spline-smoothing/#comment-192380</link>
		<dc:creator><![CDATA[Basil]]></dc:creator>
		<pubDate>Tue, 08 Sep 2009 13:09:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=6894#comment-192380</guid>
		<description><![CDATA[Re: &lt;a href=&quot;#comment-355302&quot; rel=&quot;nofollow&quot;&gt;Geoff Sherrington (#173)&lt;/a&gt;,
&lt;blockquote&gt;The four graphs you provide have mechanisms attributed to them. href=&quot;#comment-354904&quot;&gt;Basil (#134)

What assurance can you give that these mechanisms or interpretations are both necessary and sufficient to explain the response for graphs 2-4?

Take the hypothetical case where climatologists were still unaware of ENSO, but were aware of some other unrelated physical processes. Would the graphs be labelled with these other processes? Would they be any more right or any more wrong than your attributions?

What if there exists an undiscovered mechanism that accounts for parts of graphs 2-4?&lt;/blockquote&gt;Well, we know now that Newtonian mechanics does not account for everything we can observe in the physical world, but the fact that there existed undiscovered mechanisms that account for part of what we observe in the physical world doesn&#039;t invalidate the usefulness of classical mechanics.  I didn&#039;t suggest that the mechanisms I was attributing to the various graphs were capable of explaining them comprehensively.  I was really making a much less grandiose claim than you would have make.  It is a truism that climate varies on all time scales.  I was just illustrating that with the graphs.  That&#039;s all.  I wasn&#039;t proposing a general theory of climate.]]></description>
		<content:encoded><![CDATA[<p>Re: <a href="#comment-355302" rel="nofollow">Geoff Sherrington (#173)</a>,</p>
<blockquote><p>The four graphs you provide have mechanisms attributed to them. href=&#8221;#comment-354904&#8243;&gt;Basil (#134)</p>
<p>What assurance can you give that these mechanisms or interpretations are both necessary and sufficient to explain the response for graphs 2-4?</p>
<p>Take the hypothetical case where climatologists were still unaware of ENSO, but were aware of some other unrelated physical processes. Would the graphs be labelled with these other processes? Would they be any more right or any more wrong than your attributions?</p>
<p>What if there exists an undiscovered mechanism that accounts for parts of graphs 2-4?</p></blockquote>
<p>Well, we know now that Newtonian mechanics does not account for everything we can observe in the physical world, but the fact that there existed undiscovered mechanisms that account for part of what we observe in the physical world doesn&#8217;t invalidate the usefulness of classical mechanics.  I didn&#8217;t suggest that the mechanisms I was attributing to the various graphs were capable of explaining them comprehensively.  I was really making a much less grandiose claim than you would have make.  It is a truism that climate varies on all time scales.  I was just illustrating that with the graphs.  That&#8217;s all.  I wasn&#8217;t proposing a general theory of climate.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Basil</title>
		<link>http://climateaudit.org/2009/08/23/spline-smoothing/#comment-192379</link>
		<dc:creator><![CDATA[Basil]]></dc:creator>
		<pubDate>Tue, 08 Sep 2009 12:50:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=6894#comment-192379</guid>
		<description><![CDATA[Re: &lt;a href=&quot;#comment-355469&quot; rel=&quot;nofollow&quot;&gt;Hu McCulloch (#179)&lt;/a&gt;, Since I don&#039;t have matlab, when you can, I&#039;d appreciate seeing your graph of this.

John S, #176&lt;blockquote&gt;
BTW, your chosen example also shows how incoherent the low-frequency temperature variations are in different regions, with differences that are as large or larger than the variations. Similar disparities are often seen between intra-regional stations. A &quot;global temperature signal&quot; is merely a statistical construct, rather than a ubiquitously measurable reality.&lt;/blockquote&gt;Yes, my chosen example illustrated how different the low frequency variation can be regionally, but within the 9 divisional data sets available to the US, they do break out into three roughly coherent regions, along geographically rational subdivisions (the two coasts, and the continental interior).  As for a &quot;global temperature signal,&quot; that it is a statistical construct doesn&#039;t mean that there might not be discernible influences on it.  Just like stock market indexes remove the &quot;systematic risk&quot; of individual investments, a global average removes a lot of the variance in regional temperatures, leaving behind something notionally indicative of what is happening globally to terrestrial temperatures.]]></description>
		<content:encoded><![CDATA[<p>Re: <a href="#comment-355469" rel="nofollow">Hu McCulloch (#179)</a>, Since I don&#8217;t have matlab, when you can, I&#8217;d appreciate seeing your graph of this.</p>
<p>John S, #176<br />
<blockquote>
BTW, your chosen example also shows how incoherent the low-frequency temperature variations are in different regions, with differences that are as large or larger than the variations. Similar disparities are often seen between intra-regional stations. A &#8220;global temperature signal&#8221; is merely a statistical construct, rather than a ubiquitously measurable reality.</p></blockquote>
<p>Yes, my chosen example illustrated how different the low frequency variation can be regionally, but within the 9 divisional data sets available to the US, they do break out into three roughly coherent regions, along geographically rational subdivisions (the two coasts, and the continental interior).  As for a &#8220;global temperature signal,&#8221; that it is a statistical construct doesn&#8217;t mean that there might not be discernible influences on it.  Just like stock market indexes remove the &#8220;systematic risk&#8221; of individual investments, a global average removes a lot of the variance in regional temperatures, leaving behind something notionally indicative of what is happening globally to terrestrial temperatures.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hu McCulloch</title>
		<link>http://climateaudit.org/2009/08/23/spline-smoothing/#comment-192378</link>
		<dc:creator><![CDATA[Hu McCulloch]]></dc:creator>
		<pubDate>Tue, 08 Sep 2009 04:38:21 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=6894#comment-192378</guid>
		<description><![CDATA[RE JohnS #178,
Wordpress isn&#039;t letting me upload files to CA at the moment, but here is a MATLAB routine that computes the HP filter and its weights:

function [y,W] = hodrickp(x, lambda)
% y = hodrickp(x)
% y is smoothed version of x
% Formula derived in Ekkehart Schlicht, &quot;Estimating the Smoothing Parameter
% in the So-Called Hodrick-Prescott filter&quot;,
% http://epub.ub.uni-muenchen.de/304/1/schlicht-HP-3-DP.pdf
n = length(x);
P = toeplitz([-2 1 zeros(1,n-2)]);
P = P(2:n-1,:);  % P generates second differences
W = inv(eye(n) + lambda*P&#039;*P);
y = W*x;
% This routine is inefficient for large n.  An interative routine
% based on the Extended Kalman Filter exists that takes
% less memory and is faster.

The weights in W are nearly symmetric near the center of the sample, and become highly skewed towards the ends.  They do not respond to the data (x), but do respond to nearness to the endpoints.  Furthermore, they are bilateral, in that they reach both forward and backwards (except at the last point, of course).  Near the center, the weights have a bell-shaped center, with 2 negative wings, but no oscillations beyond the first overshoot, unlike the &quot;Clark&quot; filter in #156, or even the spline in the post.]]></description>
		<content:encoded><![CDATA[<p>RE JohnS #178,<br />
Wordpress isn&#8217;t letting me upload files to CA at the moment, but here is a MATLAB routine that computes the HP filter and its weights:</p>
<p>function [y,W] = hodrickp(x, lambda)<br />
% y = hodrickp(x)<br />
% y is smoothed version of x<br />
% Formula derived in Ekkehart Schlicht, &#8220;Estimating the Smoothing Parameter<br />
% in the So-Called Hodrick-Prescott filter&#8221;,<br />
% <a href="http://epub.ub.uni-muenchen.de/304/1/schlicht-HP-3-DP.pdf" rel="nofollow">http://epub.ub.uni-muenchen.de/304/1/schlicht-HP-3-DP.pdf</a><br />
n = length(x);<br />
P = toeplitz([-2 1 zeros(1,n-2)]);<br />
P = P(2:n-1,:);  % P generates second differences<br />
W = inv(eye(n) + lambda*P&#8217;*P);<br />
y = W*x;<br />
% This routine is inefficient for large n.  An interative routine<br />
% based on the Extended Kalman Filter exists that takes<br />
% less memory and is faster.</p>
<p>The weights in W are nearly symmetric near the center of the sample, and become highly skewed towards the ends.  They do not respond to the data (x), but do respond to nearness to the endpoints.  Furthermore, they are bilateral, in that they reach both forward and backwards (except at the last point, of course).  Near the center, the weights have a bell-shaped center, with 2 negative wings, but no oscillations beyond the first overshoot, unlike the &#8220;Clark&#8221; filter in #156, or even the spline in the post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John S.</title>
		<link>http://climateaudit.org/2009/08/23/spline-smoothing/#comment-192377</link>
		<dc:creator><![CDATA[John S.]]></dc:creator>
		<pubDate>Mon, 07 Sep 2009 18:22:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.climateaudit.org/?p=6894#comment-192377</guid>
		<description><![CDATA[Re: &lt;a href=&quot;#comment-355305&quot; rel=&quot;nofollow&quot;&gt;Hu McCulloch (#175)&lt;/a&gt;,

HP has been used very little ouside of econometrics and many of us here are trying to fathom its operational principles.  If, for any set value of the smoothing parameter, HP indeed uses a fixed linear combination of data uniformly throughout the record, then the frequency response can be calculated from the coefficients (or weights).  I&#039;ve not seen this done anywhere.  Although one can supposition some correlation structures that would render the Kalman filter no longer data-adaptive, it remains inherently a unilateral (i.e., causal) operation.  This raises anew the question of end-treatment. Given the apparent zero-phase response of HP, one expects it to be--by contrast--bilaterally symmetric, with smoothed values provided everywhere by circular treatment of data, similar to IDFT reconstruction.  Perhaps you can point us to the econometric literature where these specifics are discussed.]]></description>
		<content:encoded><![CDATA[<p>Re: <a href="#comment-355305" rel="nofollow">Hu McCulloch (#175)</a>,</p>
<p>HP has been used very little ouside of econometrics and many of us here are trying to fathom its operational principles.  If, for any set value of the smoothing parameter, HP indeed uses a fixed linear combination of data uniformly throughout the record, then the frequency response can be calculated from the coefficients (or weights).  I&#8217;ve not seen this done anywhere.  Although one can supposition some correlation structures that would render the Kalman filter no longer data-adaptive, it remains inherently a unilateral (i.e., causal) operation.  This raises anew the question of end-treatment. Given the apparent zero-phase response of HP, one expects it to be&#8211;by contrast&#8211;bilaterally symmetric, with smoothed values provided everywhere by circular treatment of data, similar to IDFT reconstruction.  Perhaps you can point us to the econometric literature where these specifics are discussed.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
