<?xml version="1.0" encoding="UTF-8" standalone="yes"?><oembed><version><![CDATA[1.0]]></version><provider_name><![CDATA[Azimuth]]></provider_name><provider_url><![CDATA[https://johncarlosbaez.wordpress.com]]></provider_url><author_name><![CDATA[John Baez]]></author_name><author_url><![CDATA[https://johncarlosbaez.wordpress.com/author/johncarlosbaez/]]></author_url><title><![CDATA[Exploring Climate Data (Part&nbsp;1)]]></title><type><![CDATA[link]]></type><html><![CDATA[<p><i>joint with <b>Dara O Shayda</b></i></p>
<p>Emboldened by our <a href="http://www.azimuthproject.org/azimuth/show/Experiments+in+El+Ni%C3%B1o+analysis+and+prediction+">experiments in El Ni&ntilde;o analysis and prediction</a>, people in the <a href="http://www.azimuthproject.org/azimuth/show/Azimuth+Code+Project">Azimuth Code Project</a> have been starting to analyze weather and climate data.  A lot of this work is exploratory, with no big conclusions.  But it&#8217;s still interesting!  So, let&#8217;s try some blog articles where we present this work.</p>
<p>This one will be about the air pressure on the island of Tahiti and in a city called Darwin in Australia: how they&#8217;re correlated, and how each one varies.  This article will also be a quick introduction to some basic statistics, as well as &#8216;continuous wavelet transforms&#8217;.</p>
<h3> Darwin, Tahiti and El Ni&ntilde;os </h3>
<p>The El Ni&ntilde;o Southern Oscillation is often studied using the air pressure in Darwin, Australia versus the air pressure in Tahiti.  When there&#8217;s an El Ni&ntilde;o, it gets stormy in the eastern Pacific so the air temperatures tend to be lower in Tahiti and higher in Darwin.  When there&#8217;s a La Ni&ntilde;a, it&#8217;s the other way around:</p>
<div align="center">
<a href="http://www.bom.gov.au/watl/about-weather-and-climate/australian-climate-influences.shtml?bookmark=enso"><br />
<img border="none" src="https://i1.wp.com/math.ucr.edu/home/baez/ecological/el_nino/ensoanim.gif" alt="" /><br />
</a>
</div>
<p>The <a href="http://www.azimuthproject.org/azimuth/show/ENSO#SOI">Southern Oscillation Index</a> or <b>SOI</b> is a normalized version of the monthly mean air pressure anomaly in Tahiti minus that in Darwin.   Here <b>anomaly</b> means we subtract off the mean, and <b>normalized</b> means that we divide by the standard deviation.  </p>
<p>So, the SOI tends to be negative when there&#8217;s an El Ni&ntilde;o.  On the other hand, when there&#8217;s an El Ni&ntilde;o the <a href="http://www.azimuthproject.org/azimuth/show/ENSO#Nino3.4">Ni&ntilde;o 3.4 index</a> tends to be positive&mdash;this says it&#8217;s hotter than usual in a certain patch of the Pacific.  </p>
<p>Here you can see how this works:</p>
<div align="center">
<a href="http://www.cpc.ncep.noaa.gov/products/analysis_monitoring/ensocycle/soi.shtml"><br />
<img width="450" border="none" src="https://i2.wp.com/www.cpc.ncep.noaa.gov/products/analysis_monitoring/ensocycle/soi_nino34.gif" /><br />
</a>
</div>
<p>When the Ni&ntilde;o 3.4 index is positive, the SOI tends to be negative, and vice versa!</p>
<p>It might be fun to explore precisely how well correlated they are.  You can get the data to do that by clicking on the links above.   </p>
<p>But here&#8217;s another question: how similar are the air pressure anomalies in Darwin and in Tahiti?  Do we really need to take their difference, or are they so strongly anticorrelated that either one would be enough to detect an El Ni&ntilde;o?</p>
<p>You can get the data to answer such questions here:</p>
<p>&bull; <a href="http://www.cgd.ucar.edu/cas/catalog/climind/soiAnnual.html">Southern Oscillation Index based upon annual standardization</a>, Climate Analysis Section, NCAR/UCAR.  This includes links to monthly sea level pressure anomalies in <a href="http://www.cgd.ucar.edu/cas/catalog/climind/darwin.anom.ascii">Darwin</a> and <a href="http://www.cgd.ucar.edu/cas/catalog/climind/tahiti.anom.ascii">Tahiti</a>, in either ASCII format (click the second two links) or netCDF format (click the first one and read the explanation).</p>
<p>In fact this website has some nice graphs already made, which I might as well show you!  Here&#8217;s the SOI and also the <i>sum</i> of the air pressure anomalies in Darwin and Tahiti, normalized in some way:</p>
<div align="center">
<a href="http://math.ucr.edu/home/baez/ecological/el_nino/soi_and_tahiti+darwin.gif"><br />
<img width="450" src="https://i0.wp.com/math.ucr.edu/home/baez/ecological/el_nino/soi_and_tahiti+darwin.gif" /></a>
</div>
<p>(Click to enlarge.)</p>
<p>If the sum were zero, the air pressure anomalies in Darwin and Tahiti would contain the same information and life would be simple.  But it&#8217;s not!</p>
<p>How similar in character are the air pressure anomalies in Darwin and Tahiti? There are many ways to study this question.  Dara tackled it by taking the air pressure anomaly data from 1866 to 2012 and computing some &#8216;continuous wavelet transforms&#8217; of these air pressure anomalies.  This is a good excuse for explaining how a continuous wavelet transform works.</p>
<h3> Very basic statistics </h3>
<p>It helps to start with some very basic statistics.  Suppose you have a list of numbers </p>
<p><img src='https://s0.wp.com/latex.php?latex=x+%3D+%28x_1%2C+%5Cdots%2C+x_n%29+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x = (x_1, &#92;dots, x_n) ' title='x = (x_1, &#92;dots, x_n) ' class='latex' />  </p>
<p>You probably know how to take their <b><a href="https://en.wikipedia.org/wiki/Arithmetic_mean">mean</a></b>, or average.  People often write this with angle brackets:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Clangle+x+%5Crangle+%3D+%5Cfrac%7B1%7D%7Bn%7D+%5Csum_%7Bi+%3D+1%7D%5En+x_i+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ &#92;langle x &#92;rangle = &#92;frac{1}{n} &#92;sum_{i = 1}^n x_i } ' title='&#92;displaystyle{ &#92;langle x &#92;rangle = &#92;frac{1}{n} &#92;sum_{i = 1}^n x_i } ' class='latex' /></p>
<p>You can also calculate the mean of their squares:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B++%5Clangle+x%5E2+%5Crangle+%3D+%5Cfrac%7B1%7D%7Bn%7D+%5Csum_%7Bi+%3D+1%7D%5En+x_i%5E2+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{  &#92;langle x^2 &#92;rangle = &#92;frac{1}{n} &#92;sum_{i = 1}^n x_i^2 } ' title='&#92;displaystyle{  &#92;langle x^2 &#92;rangle = &#92;frac{1}{n} &#92;sum_{i = 1}^n x_i^2 } ' class='latex' /></p>
<p>If you were naive you might think <img src='https://s0.wp.com/latex.php?latex=%5Clangle+x%5E2+%5Crangle+%3D+%5Clangle+x+%5Crangle%5E2%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;langle x^2 &#92;rangle = &#92;langle x &#92;rangle^2,' title='&#92;langle x^2 &#92;rangle = &#92;langle x &#92;rangle^2,' class='latex' /> but in fact we have:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Clangle+x%5E2+%5Crangle+%5Cge+%5Clangle+x+%5Crangle%5E2+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;langle x^2 &#92;rangle &#92;ge &#92;langle x &#92;rangle^2 ' title='&#92;langle x^2 &#92;rangle &#92;ge &#92;langle x &#92;rangle^2 ' class='latex' /></p>
<p>and they&#8217;re equal only if all the <img src='https://s0.wp.com/latex.php?latex=x_i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x_i' title='x_i' class='latex' /> are the same.  The point is that if the numbers <img src='https://s0.wp.com/latex.php?latex=x_i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x_i' title='x_i' class='latex' /> are spread out, the squares of the big ones (positive or negative) contribute more to the average of the squares than if we had averaged them out before squaring.  The difference</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Clangle+x%5E2+%5Crangle+-+%5Clangle+x+%5Crangle%5E2+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;langle x^2 &#92;rangle - &#92;langle x &#92;rangle^2 ' title='&#92;langle x^2 &#92;rangle - &#92;langle x &#92;rangle^2 ' class='latex' /></p>
<p>is called the <b><a href="https://en.wikipedia.org/wiki/Variance">variance</a></b>; it says how spread out our numbers are.  The square root of the variance is the <b><a href="https://en.wikipedia.org/wiki/Standard_deviation">standard deviation</a></b>:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Csigma_x+%3D+%5Csqrt%7B%5Clangle+x%5E2+%5Crangle+-+%5Clangle+x+%5Crangle%5E2+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;sigma_x = &#92;sqrt{&#92;langle x^2 &#92;rangle - &#92;langle x &#92;rangle^2 } ' title='&#92;sigma_x = &#92;sqrt{&#92;langle x^2 &#92;rangle - &#92;langle x &#92;rangle^2 } ' class='latex' /></p>
<p>and this has the slight advantage that if you multiply all the numbers <img src='https://s0.wp.com/latex.php?latex=x_i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x_i' title='x_i' class='latex' /> by some constant <img src='https://s0.wp.com/latex.php?latex=c%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='c,' title='c,' class='latex' /> the standard deviation gets multiplied by <img src='https://s0.wp.com/latex.php?latex=%7Cc%7C.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='|c|.' title='|c|.' class='latex' />  (The variance gets multiplied by <img src='https://s0.wp.com/latex.php?latex=c%5E2.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='c^2.' title='c^2.' class='latex' />)</p>
<p>We can generalize the variance to a situation where we have two lists of numbers: </p>
<p><img src='https://s0.wp.com/latex.php?latex=x+%3D+%28x_1%2C+%5Cdots%2C+x_n%29+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x = (x_1, &#92;dots, x_n) ' title='x = (x_1, &#92;dots, x_n) ' class='latex' />  </p>
<p><img src='https://s0.wp.com/latex.php?latex=y+%3D+%28y_1%2C+%5Cdots%2C+y_n%29+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y = (y_1, &#92;dots, y_n) ' title='y = (y_1, &#92;dots, y_n) ' class='latex' />  </p>
<p>Namely, we can form the <b><a href="https://en.wikipedia.org/wiki/Covariance">covariance</a></b></p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Clangle+x+y+%5Crangle+-+%5Clangle+x+%5Crangle+%5Clangle+y+%5Crangle+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;langle x y &#92;rangle - &#92;langle x &#92;rangle &#92;langle y &#92;rangle ' title='&#92;langle x y &#92;rangle - &#92;langle x &#92;rangle &#92;langle y &#92;rangle ' class='latex' /></p>
<p>This reduces to the variance when <img src='https://s0.wp.com/latex.php?latex=x+%3D+y.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x = y.' title='x = y.' class='latex' />  It measures how much <img src='https://s0.wp.com/latex.php?latex=x&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x' title='x' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' /> vary together &mdash; &#8216;hand in hand&#8217;, as it were.  A bit more precisely: if <img src='https://s0.wp.com/latex.php?latex=x_i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x_i' title='x_i' class='latex' /> is greater than its mean value mainly for <img src='https://s0.wp.com/latex.php?latex=i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='i' title='i' class='latex' /> such that <img src='https://s0.wp.com/latex.php?latex=y_i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y_i' title='y_i' class='latex' /> is greater than <i>its</i> mean value, the covariance is positive.  On the other hand, if <img src='https://s0.wp.com/latex.php?latex=x_i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x_i' title='x_i' class='latex' /> tends to be greater than average when <img src='https://s0.wp.com/latex.php?latex=y_i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y_i' title='y_i' class='latex' /> is <i>smaller</i> than average &mdash; like with the air pressures at Darwin and Tahiti &mdash; the covariance will be negative.</p>
<p>For example, if </p>
<p><img src='https://s0.wp.com/latex.php?latex=x+%3D+%281%2C-1%29%2C+%5Cquad+y+%3D+%281%2C-1%29+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x = (1,-1), &#92;quad y = (1,-1) ' title='x = (1,-1), &#92;quad y = (1,-1) ' class='latex' /></p>
<p>then they &#8216;vary hand in hand&#8217;, and the covariance</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Clangle+x+y+%5Crangle+-+%5Clangle+x+%5Crangle+%5Clangle+y+%5Crangle+%3D+1+-+0+%3D+1+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;langle x y &#92;rangle - &#92;langle x &#92;rangle &#92;langle y &#92;rangle = 1 - 0 = 1 ' title='&#92;langle x y &#92;rangle - &#92;langle x &#92;rangle &#92;langle y &#92;rangle = 1 - 0 = 1 ' class='latex' /></p>
<p>is positive.  But if</p>
<p><img src='https://s0.wp.com/latex.php?latex=x+%3D+%281%2C-1%29%2C+%5Cquad+y+%3D+%28-1%2C1%29+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x = (1,-1), &#92;quad y = (-1,1) ' title='x = (1,-1), &#92;quad y = (-1,1) ' class='latex' /></p>
<p>then one is positive when the other is negative, so the covariance</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Clangle+x+y+%5Crangle+-+%5Clangle+x+%5Crangle+%5Clangle+y+%5Crangle+%3D+-1+-+0+%3D+-1+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;langle x y &#92;rangle - &#92;langle x &#92;rangle &#92;langle y &#92;rangle = -1 - 0 = -1 ' title='&#92;langle x y &#92;rangle - &#92;langle x &#92;rangle &#92;langle y &#92;rangle = -1 - 0 = -1 ' class='latex' /></p>
<p>is negative.  </p>
<p>Of course the covariance will get bigger if we multiply both <img src='https://s0.wp.com/latex.php?latex=x&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x' title='x' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' /> by some big number.  If we don&#8217;t want this effect, we can normalize the covariance and get the <b><a href="https://en.wikipedia.org/wiki/Correlation#Pearson.27s_product-moment_coefficient">correlation</a></b>:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cfrac%7B+%5Clangle+x+y+%5Crangle+-+%5Clangle+x+%5Crangle+%5Clangle+y+%5Crangle+%7D%7B%5Csigma_x+%5Csigma_y%7D+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ &#92;frac{ &#92;langle x y &#92;rangle - &#92;langle x &#92;rangle &#92;langle y &#92;rangle }{&#92;sigma_x &#92;sigma_y} } ' title='&#92;displaystyle{ &#92;frac{ &#92;langle x y &#92;rangle - &#92;langle x &#92;rangle &#92;langle y &#92;rangle }{&#92;sigma_x &#92;sigma_y} } ' class='latex' /></p>
<p>which will always be between <img src='https://s0.wp.com/latex.php?latex=-1&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='-1' title='-1' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=1.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='1.' title='1.' class='latex' />   </p>
<p>For example, if we compute the correlation between the air pressure anomalies at Darwin and Tahiti, measured monthly from 1866 to 2012, we get<br />
-0.253727.  This indicates that when one goes up, the other tends to go down.  But since we&#8217;re not getting -1, it means they&#8217;re not completely locked into a linear relationship where one is some negative number times the other.</p>
<p>Okay, we&#8217;re almost ready for continuous wavelet transforms!   Here is the main thing we need to know.  If the mean of either <img src='https://s0.wp.com/latex.php?latex=x&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x' title='x' class='latex' /> or <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' /> is zero, the formula for covariance simplifies a lot, to</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B++%5Clangle+x+y+%5Crangle+%3D+%5Cfrac%7B1%7D%7Bn%7D+%5Csum_%7Bi+%3D+1%7D%5En+x_i+y_i+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{  &#92;langle x y &#92;rangle = &#92;frac{1}{n} &#92;sum_{i = 1}^n x_i y_i } ' title='&#92;displaystyle{  &#92;langle x y &#92;rangle = &#92;frac{1}{n} &#92;sum_{i = 1}^n x_i y_i } ' class='latex' /></p>
<p>So, this quantity says how much the numbers <img src='https://s0.wp.com/latex.php?latex=x_i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x_i' title='x_i' class='latex' /> &#8216;vary hand in hand&#8217; with the numbers <img src='https://s0.wp.com/latex.php?latex=y_i%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y_i,' title='y_i,' class='latex' /> in the special case when one (or both) has mean zero.</p>
<p>We can do something similar if <img src='https://s0.wp.com/latex.php?latex=x%2C+y+%3A+%5Cmathbb%7BR%7D+%5Cto+%5Cmathbb%7BR%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x, y : &#92;mathbb{R} &#92;to &#92;mathbb{R}' title='x, y : &#92;mathbb{R} &#92;to &#92;mathbb{R}' class='latex' /> are functions of time defined for all real numbers <img src='https://s0.wp.com/latex.php?latex=t.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='t.' title='t.' class='latex' />  The sum becomes an integral, and we have to give up on dividing by <img src='https://s0.wp.com/latex.php?latex=n.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='n.' title='n.' class='latex' />  We get:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B++%5Cint_%7B-%5Cinfty%7D%5E%5Cinfty+x%28t%29+y%28t%29%5C%3B+d+t+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{  &#92;int_{-&#92;infty}^&#92;infty x(t) y(t)&#92;; d t } ' title='&#92;displaystyle{  &#92;int_{-&#92;infty}^&#92;infty x(t) y(t)&#92;; d t } ' class='latex' /></p>
<p>This is called the <b>inner product</b> of the functions <img src='https://s0.wp.com/latex.php?latex=x&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x' title='x' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=y%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y,' title='y,' class='latex' /> and often it&#8217;s written <img src='https://s0.wp.com/latex.php?latex=%5Clangle+x%2C+y+%5Crangle%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;langle x, y &#92;rangle,' title='&#92;langle x, y &#92;rangle,' class='latex' /> but it&#8217;s a lot like the covariance.</p>
<h3> Continuous wavelet transforms </h3>
<p>What are continuous wavelet transforms, and why should we care?</p>
<p>People have lots of tricks for studying &#8216;signals&#8217;, like series of numbers <img src='https://s0.wp.com/latex.php?latex=x_i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x_i' title='x_i' class='latex' /> or functions <img src='https://s0.wp.com/latex.php?latex=x+%3A+%5Cmathbb%7BR%7D+%5Cto+%5Cmathbb%7BR%7D.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x : &#92;mathbb{R} &#92;to &#92;mathbb{R}.' title='x : &#92;mathbb{R} &#92;to &#92;mathbb{R}.' class='latex' />  One method is to &#8216;transform&#8217; the signal in a way that reveals useful information.  The <a href="https://en.wikipedia.org/wiki/Fourier_transform">Fourier transform</a> decomposes a signal into sines and cosines of different frequencies.  This lets us see how much power the signal has at different frequencies, but it doesn&#8217;t reveal how the power at different frequencies <i>changes with time</i>.  For that we should use something else, like the <a href="https://johncarlosbaez.wordpress.com/2013/01/30/milankovich-vs-the-ice-ages/">Gabor transform</a> explained by Blake Pollard in a previous post.</p>
<p>Sines and cosines are great, but we might want to look for other patterns in a signal.  A &#8216;continuous wavelet transform&#8217; lets us scan a signal for appearances of a given pattern at different <i>times</i> and also at different <i>time scales</i>: a pattern could go by quickly, or in a stretched out slow way.  </p>
<p>To implement the continuous wavelet transform, we need a signal and a pattern to look for.  The signal could be a function <img src='https://s0.wp.com/latex.php?latex=x+%3A+%5Cmathbb%7BR%7D+%5Cto+%5Cmathbb%7BR%7D.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x : &#92;mathbb{R} &#92;to &#92;mathbb{R}.' title='x : &#92;mathbb{R} &#92;to &#92;mathbb{R}.' class='latex' />  The pattern would then be another function <img src='https://s0.wp.com/latex.php?latex=y%3A+%5Cmathbb%7BR%7D+%5Cto+%5Cmathbb%7BR%7D%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y: &#92;mathbb{R} &#92;to &#92;mathbb{R},' title='y: &#92;mathbb{R} &#92;to &#92;mathbb{R},' class='latex' /> usually called a <b><a href="https://en.wikipedia.org/wiki/Wavelet">wavelet</a></b>.  </p>
<p>Here&#8217;s an example of a wavelet:</p>
<div align="center">
<a href="http://math.ucr.edu/home/baez/ecological/shayda/DGauss4.jpg"><br />
<img src="https://i1.wp.com/math.ucr.edu/home/baez/ecological/shayda/DGauss4.jpg" /></a>
</div>
<p>If we&#8217;re in a relaxed mood, we could call <i>any</i> function that looks like a bump with wiggles in it a wavelet.  There are lots of famous wavelets, but this particular one is the fourth derivative of a certain Gaussian.  Mathematica calls this particular wavelet <a href="http://reference.wolfram.com/language/ref/DGaussianWavelet.html">DGaussianWavelet[4]</a>, and you can look up the formula under &#8216;Details&#8217; on their webpage.  </p>
<p>However, the exact formula doesn&#8217;t matter at all now!  If we call this wavelet <img src='https://s0.wp.com/latex.php?latex=y%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y,' title='y,' class='latex' /> all that matters is that it&#8217;s a bump with wiggles on it, and that its mean value is 0, or more precisely:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cint_%7B-%5Cinfty%7D%5E%5Cinfty+y%28t%29+%5C%3B+d+t+%3D+0+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ &#92;int_{-&#92;infty}^&#92;infty y(t) &#92;; d t = 0 } ' title='&#92;displaystyle{ &#92;int_{-&#92;infty}^&#92;infty y(t) &#92;; d t = 0 } ' class='latex' /> </p>
<p>As we saw in the last section, this fact lets us take our function <img src='https://s0.wp.com/latex.php?latex=x&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x' title='x' class='latex' /> and the wavelet <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' /> and see how much they &#8216;vary hand it hand&#8217; simply by computing their inner product:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Clangle+x+%2C+y+%5Crangle+%3D+%5Cint_%7B-%5Cinfty%7D%5E%5Cinfty+x%28t%29+y%28t%29%5C%3B+d+t+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ &#92;langle x , y &#92;rangle = &#92;int_{-&#92;infty}^&#92;infty x(t) y(t)&#92;; d t } ' title='&#92;displaystyle{ &#92;langle x , y &#92;rangle = &#92;int_{-&#92;infty}^&#92;infty x(t) y(t)&#92;; d t } ' class='latex' /></p>
<p>Loosely speaking, this measures the &#8216;amount of <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' />-shaped wiggle in the function <img src='https://s0.wp.com/latex.php?latex=x&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x' title='x' class='latex' />’.  It&#8217;s amazing how hard it is to say something in plain English that perfectly captures the meaning of a simple formula like the above one&mdash;so take the quoted phrase with a huge grain of salt.  But it gives a rough intuition.</p>
<p>Our wavelet <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' /> happens to be centered at <img src='https://s0.wp.com/latex.php?latex=t++%3D+0.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='t  = 0.' title='t  = 0.' class='latex' />  However, we might be interested in <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' />-shaped wiggles that are centered not at zero but at some other number <img src='https://s0.wp.com/latex.php?latex=s.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s.' title='s.' class='latex' />  We could detect these by shifting the function <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' /> before taking its inner product with <img src='https://s0.wp.com/latex.php?latex=x&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x' title='x' class='latex' />:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cint_%7B-%5Cinfty%7D%5E%5Cinfty+x%28t%29+y%28t-s%29%5C%3B+d+t+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ &#92;int_{-&#92;infty}^&#92;infty x(t) y(t-s)&#92;; d t } ' title='&#92;displaystyle{ &#92;int_{-&#92;infty}^&#92;infty x(t) y(t-s)&#92;; d t } ' class='latex' /></p>
<p>We could also be interested in measuring the amount of some stretched-out or squashed version of a <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' />-shaped wiggle in the function <img src='https://s0.wp.com/latex.php?latex=x.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x.' title='x.' class='latex' />  Again we could do this by changing <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' /> before taking its inner product with <img src='https://s0.wp.com/latex.php?latex=x&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x' title='x' class='latex' />:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cint_%7B-%5Cinfty%7D%5E%5Cinfty+x%28t%29+%5C%3B+y%5Cleft%28%5Cfrac%7Bt%7D%7BP%7D%5Cright%29+%5C%3B+d+t+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ &#92;int_{-&#92;infty}^&#92;infty x(t) &#92;; y&#92;left(&#92;frac{t}{P}&#92;right) &#92;; d t } ' title='&#92;displaystyle{ &#92;int_{-&#92;infty}^&#92;infty x(t) &#92;; y&#92;left(&#92;frac{t}{P}&#92;right) &#92;; d t } ' class='latex' /></p>
<p>When <img src='https://s0.wp.com/latex.php?latex=P&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='P' title='P' class='latex' /> is big, we get a stretched-out version of <img src='https://s0.wp.com/latex.php?latex=y.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y.' title='y.' class='latex' />  People sometimes call <img src='https://s0.wp.com/latex.php?latex=P&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='P' title='P' class='latex' /> the <b>period</b>, since the period of the wiggles in <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' /> will be proportional to this (though usually not equal to it).</p>
<p>Finally, we can combine these ideas, and compute</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Cint_%7B-%5Cinfty%7D%5E%5Cinfty+x%28t%29+%5C%3B+y%5Cleft%28%5Cfrac%7Bt-+s%7D%7BP%7D%5Cright%29%5C%3B+dt+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ &#92;int_{-&#92;infty}^&#92;infty x(t) &#92;; y&#92;left(&#92;frac{t- s}{P}&#92;right)&#92;; dt } ' title='&#92;displaystyle{ &#92;int_{-&#92;infty}^&#92;infty x(t) &#92;; y&#92;left(&#92;frac{t- s}{P}&#92;right)&#92;; dt } ' class='latex' /></p>
<p>This is a function of the shift <img src='https://s0.wp.com/latex.php?latex=s&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s' title='s' class='latex' /> and period <img src='https://s0.wp.com/latex.php?latex=P&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='P' title='P' class='latex' /> which says how much of the <img src='https://s0.wp.com/latex.php?latex=s&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s' title='s' class='latex' />-shifted, <img src='https://s0.wp.com/latex.php?latex=P&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='P' title='P' class='latex' />-stretched wavelet <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' /> is lurking in the function <img src='https://s0.wp.com/latex.php?latex=x.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x.' title='x.' class='latex' />  It&#8217;s a version of the continuous wavelet transform!</p>
<p>Mathematica implements this idea for <a href="https://en.wikipedia.org/wiki/Time_series"><b>time series</b></a>, meaning lists of numbers <img src='https://s0.wp.com/latex.php?latex=x+%3D+%28x_1%2C%5Cdots%2Cx_n%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x = (x_1,&#92;dots,x_n)' title='x = (x_1,&#92;dots,x_n)' class='latex' /> instead of functions <img src='https://s0.wp.com/latex.php?latex=x+%3A+%5Cmathbb%7BR%7D+%5Cto+%5Cmathbb%7BR%7D.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x : &#92;mathbb{R} &#92;to &#92;mathbb{R}.' title='x : &#92;mathbb{R} &#92;to &#92;mathbb{R}.' class='latex' />  The idea is that we think of the numbers as samples of a function <img src='https://s0.wp.com/latex.php?latex=x&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x' title='x' class='latex' />:</p>
<p><img src='https://s0.wp.com/latex.php?latex=x_1+%3D+x%28%5CDelta+t%29+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x_1 = x(&#92;Delta t) ' title='x_1 = x(&#92;Delta t) ' class='latex' /></p>
<p><img src='https://s0.wp.com/latex.php?latex=x_2+%3D+x%282+%5CDelta+t%29+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x_2 = x(2 &#92;Delta t) ' title='x_2 = x(2 &#92;Delta t) ' class='latex' /></p>
<p>and so on, where <img src='https://s0.wp.com/latex.php?latex=%5CDelta+t&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;Delta t' title='&#92;Delta t' class='latex' /> is some time step, and replace the integral above by a suitable sum.   Mathematica has a function <a href="http://reference.wolfram.com/language/ref/ContinuousWaveletTransform.html">ContinuousWaveletTransform</a> that does this, giving</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B++w%28s%2CP%29+%3D+%5Cfrac%7B1%7D%7B%5Csqrt%7BP%7D%7D+%5Csum_%7Bi+%3D+1%7D%5En+x_i+%5C%3B+y%5Cleft%28%5Cfrac%7Bi+%5CDelta+t+-+s%7D%7BP%7D%5Cright%29+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{  w(s,P) = &#92;frac{1}{&#92;sqrt{P}} &#92;sum_{i = 1}^n x_i &#92;; y&#92;left(&#92;frac{i &#92;Delta t - s}{P}&#92;right) } ' title='&#92;displaystyle{  w(s,P) = &#92;frac{1}{&#92;sqrt{P}} &#92;sum_{i = 1}^n x_i &#92;; y&#92;left(&#92;frac{i &#92;Delta t - s}{P}&#92;right) } ' class='latex' /></p>
<p>The factor of <img src='https://s0.wp.com/latex.php?latex=1%2F%5Csqrt%7BP%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='1/&#92;sqrt{P}' title='1/&#92;sqrt{P}' class='latex' /> in front is a useful extra trick: it&#8217;s the right way to compensate for the fact that when you stretch out out your wavelet <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' /> by a factor of <img src='https://s0.wp.com/latex.php?latex=P%2C&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='P,' title='P,' class='latex' /> it gets bigger.  So, when we&#8217;re doing integrals, we should define the <b>continuous wavelet transform</b> of <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' /> by:</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+w%28s%2CP%29+%3D+%5Cfrac%7B1%7D%7B%5Csqrt%7BP%7D%7D+%5Cint_%7B-%5Cinfty%7D%5E%5Cinfty+x%28t%29+y%28%5Cfrac%7Bt-+s%7D%7BP%7D%29%5C%3B+dt+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ w(s,P) = &#92;frac{1}{&#92;sqrt{P}} &#92;int_{-&#92;infty}^&#92;infty x(t) y(&#92;frac{t- s}{P})&#92;; dt } ' title='&#92;displaystyle{ w(s,P) = &#92;frac{1}{&#92;sqrt{P}} &#92;int_{-&#92;infty}^&#92;infty x(t) y(&#92;frac{t- s}{P})&#92;; dt } ' class='latex' /></p>
<h3> The results </h3>
<p>Dara Shayda started with the air pressure anomaly at Darwin and Tahiti, measured monthly from 1866 to 2012.  Taking DGaussianWavelet[4] as his wavelet, he computed the continuous wavelet transform <img src='https://s0.wp.com/latex.php?latex=w%28s%2CP%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='w(s,P)' title='w(s,P)' class='latex' /> as above.  To show us the answer, he created a <b>scalogram</b>: </p>
<div align="center">
<a href="http://math.ucr.edu/home/baez/ecological/shayda/scalogram_darwin_dgauss4.jpg"><br />
<img width="450" src="https://i1.wp.com/math.ucr.edu/home/baez/ecological/shayda/scalogram_darwin_dgauss4.jpg" /></a>
</div>
<p>This is a 2-dimensional color plot showing roughly how big the continuous wavelet transform <img src='https://s0.wp.com/latex.php?latex=w%28s%2CP%29&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='w(s,P)' title='w(s,P)' class='latex' /> is for different shifts <img src='https://s0.wp.com/latex.php?latex=s&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='s' title='s' class='latex' /> and periods <img src='https://s0.wp.com/latex.php?latex=P.&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='P.' title='P.' class='latex' />  Blue means it&#8217;s very small, green means it&#8217;s bigger, yellow means even bigger and red means very large.  </p>
<p>Tahiti gave this:</p>
<div align="center">
<a href="http://math.ucr.edu/home/baez/ecological/shayda/scalogram_tahiti_dgauss4.jpg"><br />
<img width="450" src="https://i2.wp.com/math.ucr.edu/home/baez/ecological/shayda/scalogram_tahiti_dgauss4.jpg" /></a>
</div>
<p>You&#8217;ll notice that the patterns at Darwin and Tahiti are similar in character, but notably different in detail.  For example, the red spots, where our chosen wavelet shows up strongly with period of order ~100 months, occur at different times.</p>
<p><b>Puzzle 1.</b> What is the meaning of the &#8216;spikes&#8217; in these scalograms?  What sort of signal would give a spike of this sort?</p>
<p><b>Puzzle 2.</b> Do a <a href="https://en.wikipedia.org/wiki/Gabor_transform">Gabor transform</a>, also known as a &#8216;windowed Fourier transform&#8217;, of the same data.  Blake Pollard explained the Gabor transform in his article <a href="https://johncarlosbaez.wordpress.com/2013/01/30/milankovich-vs-the-ice-ages/">Milankovitch vs the Ice Ages</a>.  This is a way to see how much a signal wiggles at a given frequency at a given time: we multiply the signal by a shifted Gaussian and then takes its Fourier transform.  </p>
<p><b>Puzzle 3.</b>  Read about continuous wavelet transforms.  If we want to reconstruct our signal <img src='https://s0.wp.com/latex.php?latex=x&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x' title='x' class='latex' /> from its continuous wavelet transform, why should we use a wavelet <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' /> with </p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B%5Cint_%7B-%5Cinfty%7D%5E%5Cinfty+y%28t%29+%5C%3B+d+t+%3D+0+%3F+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{&#92;int_{-&#92;infty}^&#92;infty y(t) &#92;; d t = 0 ? } ' title='&#92;displaystyle{&#92;int_{-&#92;infty}^&#92;infty y(t) &#92;; d t = 0 ? } ' class='latex' /></p>
<p>In fact we want a somewhat stronger condition, which is implied by the above equation when the Fourier transform of <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' /> is smooth and integrable:</p>
<p>&bull; <a href="https://en.wikipedia.org/wiki/Continuous_wavelet_transform">Continuous wavelet transform</a>, Wikipedia.</p>
<h3> Another way to understand correlations </h3>
<p>David Tweed mentioned another approach from signal processing to understanding the quantity</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B++%5Clangle+x+y+%5Crangle+%3D+%5Cfrac%7B1%7D%7Bn%7D+%5Csum_%7Bi+%3D+1%7D%5En+x_i+y_i+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{  &#92;langle x y &#92;rangle = &#92;frac{1}{n} &#92;sum_{i = 1}^n x_i y_i } ' title='&#92;displaystyle{  &#92;langle x y &#92;rangle = &#92;frac{1}{n} &#92;sum_{i = 1}^n x_i y_i } ' class='latex' /></p>
<p>If we&#8217;ve got two lists of data <img src='https://s0.wp.com/latex.php?latex=x&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='x' title='x' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=y&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='y' title='y' class='latex' /> that we want to compare to see if they behave similarly, the first thing we ought to do is multiplicatively scale each one so they&#8217;re of comparable magnitude. There are various possibilities for assigning a scale, but a reasonable one is to ensure they have equal &#8216;energy&#8217;</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B++%5Csum_%7Bi%3D1%7D%5En+x_i%5E2+%3D+%5Csum_%7Bi%3D1%7D%5En+y_i%5E2+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{  &#92;sum_{i=1}^n x_i^2 = &#92;sum_{i=1}^n y_i^2 } ' title='&#92;displaystyle{  &#92;sum_{i=1}^n x_i^2 = &#92;sum_{i=1}^n y_i^2 } ' class='latex' /></p>
<p>(This can be achieved by dividing each list by its standard deviation, which is equivalent to what was done in the main derivation above.)  Once we&#8217;ve done that then it&#8217;s clear that looking at </p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B++%5Csum_%7Bi%3D1%7D%5En+%28x_i-y_i%29%5E2+%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{  &#92;sum_{i=1}^n (x_i-y_i)^2 } ' title='&#92;displaystyle{  &#92;sum_{i=1}^n (x_i-y_i)^2 } ' class='latex' /> </p>
<p>gives small values when they have a very good match and progressively bigger values as they become less similar. Observe that</p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cbegin%7Barray%7D%7Bccl%7D++%5Cdisplaystyle%7B%5Csum_%7Bi%3D1%7D%5En+%28x_i-y_i%29%5E2+%7D++%26%3D%26+%5Cdisplaystyle%7B+%5Csum_%7Bi%3D1%7D%5En+%28x_i%5E2+-+2+x_i+y_i+%2B+y_i%5E2%29+%7D%5C%5C++%26%3D%26+%5Cdisplaystyle%7B+%5Csum_%7Bi%3D1%7D%5En+x_i%5E2+-+2+%5Csum_%7Bi%3D1%7D%5En+x_i+y_i+%2B+%5Csum_%7Bi%3D1%7D%5En+y_i%5E2+%7D++%5Cend%7Barray%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;begin{array}{ccl}  &#92;displaystyle{&#92;sum_{i=1}^n (x_i-y_i)^2 }  &amp;=&amp; &#92;displaystyle{ &#92;sum_{i=1}^n (x_i^2 - 2 x_i y_i + y_i^2) }&#92;&#92;  &amp;=&amp; &#92;displaystyle{ &#92;sum_{i=1}^n x_i^2 - 2 &#92;sum_{i=1}^n x_i y_i + &#92;sum_{i=1}^n y_i^2 }  &#92;end{array} ' title='&#92;begin{array}{ccl}  &#92;displaystyle{&#92;sum_{i=1}^n (x_i-y_i)^2 }  &amp;=&amp; &#92;displaystyle{ &#92;sum_{i=1}^n (x_i^2 - 2 x_i y_i + y_i^2) }&#92;&#92;  &amp;=&amp; &#92;displaystyle{ &#92;sum_{i=1}^n x_i^2 - 2 &#92;sum_{i=1}^n x_i y_i + &#92;sum_{i=1}^n y_i^2 }  &#92;end{array} ' class='latex' /></p>
<p>Since we&#8217;ve scaled things so that <img src='https://s0.wp.com/latex.php?latex=%5Csum_%7Bi%3D1%7D%5En+x_i%5E2&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;sum_{i=1}^n x_i^2' title='&#92;sum_{i=1}^n x_i^2' class='latex' /> and <img src='https://s0.wp.com/latex.php?latex=%5Csum_%7Bi%3D1%7D%5En+y_i%5E2&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;sum_{i=1}^n y_i^2' title='&#92;sum_{i=1}^n y_i^2' class='latex' />  are constants, we can see that when <img src='https://s0.wp.com/latex.php?latex=%5Csum_%7Bi%3D1%7D%5En+x_i+y_i&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;sum_{i=1}^n x_i y_i' title='&#92;sum_{i=1}^n x_i y_i' class='latex' /> becomes bigger, </p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B+%5Csum_%7Bi%3D1%7D%5En+%28x_i-y_i%29%5E2+%7D&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{ &#92;sum_{i=1}^n (x_i-y_i)^2 }' title='&#92;displaystyle{ &#92;sum_{i=1}^n (x_i-y_i)^2 }' class='latex' /> </p>
<p>becomes smaller.  So, </p>
<p><img src='https://s0.wp.com/latex.php?latex=%5Cdisplaystyle%7B%5Csum_%7Bi%3D1%7D%5En+x_i+y_i%7D+&#038;bg=ffffff&#038;fg=000&#038;s=0' alt='&#92;displaystyle{&#92;sum_{i=1}^n x_i y_i} ' title='&#92;displaystyle{&#92;sum_{i=1}^n x_i y_i} ' class='latex' /></p>
<p>serves as a measure of how close the lists are, under these assumptions. </p>
]]></html><thumbnail_url><![CDATA[https://i1.wp.com/math.ucr.edu/home/baez/ecological/el_nino/ensoanim.gif?fit=440%2C330]]></thumbnail_url><thumbnail_height><![CDATA[155]]></thumbnail_height><thumbnail_width><![CDATA[334]]></thumbnail_width></oembed>