<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.formulasearchengine.com/w/index.php?action=history&amp;feed=atom&amp;title=Zipper_%28data_structure%29</id>
	<title>Zipper (data structure) - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://en.formulasearchengine.com/w/index.php?action=history&amp;feed=atom&amp;title=Zipper_%28data_structure%29"/>
	<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/w/index.php?title=Zipper_(data_structure)&amp;action=history"/>
	<updated>2026-08-18T12:40:16Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.47.0-wmf.7</generator>
	<entry>
		<id>https://en.formulasearchengine.com/w/index.php?title=Zipper_(data_structure)&amp;diff=15509&amp;oldid=prev</id>
		<title>en&gt;K6ka: Reverted 1 edit by 92.4.163.22 identified as test/vandalism using STiki</title>
		<link rel="alternate" type="text/html" href="https://en.formulasearchengine.com/w/index.php?title=Zipper_(data_structure)&amp;diff=15509&amp;oldid=prev"/>
		<updated>2014-01-11T20:32:14Z</updated>

		<summary type="html">&lt;p&gt;Reverted 1 edit by &lt;a href=&quot;/wiki/Special:Contributions/92.4.163.22&quot; title=&quot;Special:Contributions/92.4.163.22&quot;&gt;92.4.163.22&lt;/a&gt; identified as test/vandalism using &lt;a href=&quot;/w/index.php?title=WP:STiki&amp;amp;action=edit&amp;amp;redlink=1&quot; class=&quot;new&quot; title=&quot;WP:STiki (page does not exist)&quot;&gt;STiki&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;The &amp;#039;&amp;#039;&amp;#039;Yamartino method&amp;#039;&amp;#039;&amp;#039; (introduced by Robert J. Yamartino in 1984) is an algorithm for calculating an approximation to the [[standard deviation]] σ&amp;lt;sub&amp;gt;θ&amp;lt;/sub&amp;gt; of [[wind direction]] θ during a single pass through the incoming data.&amp;lt;ref&amp;gt;&lt;br /&gt;
{{cite journal&lt;br /&gt;
 | author = Yamartino, R.J.&lt;br /&gt;
 | year = 1984&lt;br /&gt;
 | title = A Comparison of Several &amp;quot;Single-Pass&amp;quot; Estimators of the Standard Deviation of Wind Direction&lt;br /&gt;
 | journal = Journal of Climate and Applied Meteorology&lt;br /&gt;
 | volume = 23 | issue = 9 | pages = 1362–1366&lt;br /&gt;
 | bibcode = 1984JApMe..23.1362Y&lt;br /&gt;
 | doi = 10.1175/1520-0450(1984)023&amp;lt;1362:ACOSPE&amp;gt;2.0.CO;2&lt;br /&gt;
}}&amp;lt;/ref&amp;gt; The standard deviation of wind direction is a measure of lateral [[turbulence]], and is used in a method for estimating the [[Air pollution dispersion terminology#The Pasquill atmospheric stability classes|Pasquill stability category]].&lt;br /&gt;
&lt;br /&gt;
The typical method for calculating standard deviation requires two passes through the list of values. The first pass determines the average of those values; the second pass determines the sum of the squares of the differences between the values and the average. This double-pass method requires access to all values. A [[Standard deviation#Rapid calculation methods|single-pass method]] can be used for normal data but is unsuitable for [[Polar coordinate system|angular]] data such as wind direction where the 0°/360° (or +180°/-180°) discontinuity forces special consideration. For example, the directions 1°, 0°, and 359° (or -1°) should not average to the direction 120°!&lt;br /&gt;
&lt;br /&gt;
The Yamartino method solves both problems. The [[United States Environmental Protection Agency]] (EPA) has chosen it as the preferred way to compute the standard deviation of wind direction.&amp;lt;ref&amp;gt;[http://www.epa.gov/scram001/guidance/met/mmgrma.pdf Meteorological Monitoring Guidance for Regulatory Modeling Applications (section 6.2.1)]&amp;lt;/ref&amp;gt;&lt;br /&gt;
A further discussion of the Yamartino method, along with other methods of estimating the standard deviation of wind direction can be found in [http://journals.cambridge.org/production/action/cjoGetFulltext?fulltextid=408748 Farrugia &amp;amp; Micallef].&lt;br /&gt;
&lt;br /&gt;
==Algorithm==&lt;br /&gt;
Over the time interval to be averaged across, &amp;#039;&amp;#039;n&amp;#039;&amp;#039; measurements of wind direction (θ) will be made and two totals are accumulated without storage of the &amp;#039;&amp;#039;n&amp;#039;&amp;#039; individual values. At the end of the interval the calculations are as follows: with the average values of sinθ and cosθ defined as&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;s_a = \frac{1}{n} \sum_{i=1}^n \sin \theta_i,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;c_a = \frac{1}{n}\sum_{i=1}^n \cos \theta_i.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then the average wind direction is given via the four-quadrant arctan(x,y) function as&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\theta_a=\arctan\ (c_a,s_a).&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From twenty different functions for σ&amp;lt;sub&amp;gt;θ&amp;lt;/sub&amp;gt; using variables obtained in a single-pass of the wind direction data, Yamartino found the best function to be&lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\sigma_\theta = \arcsin (\varepsilon) \left[1+\left(\tfrac{2}{\sqrt 3} -1\right)\varepsilon^3\right], &amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where &lt;br /&gt;
&lt;br /&gt;
:&amp;lt;math&amp;gt;\varepsilon=\sqrt{1-(s^2_a+c^2_a)}.&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The key here is to remember that sin&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;θ + cos&amp;lt;sup&amp;gt;2&amp;lt;/sup&amp;gt;θ = 1 so that for example, with a constant wind direction at any value of θ, the value of &amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; will be zero, leading to a zero value for the standard deviation.&lt;br /&gt;
 &lt;br /&gt;
The use of &amp;lt;math&amp;gt;\varepsilon&amp;lt;/math&amp;gt; alone produces a result close to that produced with a double-pass when the dispersion of angles is small (not crossing the discontinuity), but by construction it is always between 0 and 1.  Taking the [[arcsine]] then produces the double-pass answer when there are just two equally common angles: in the extreme case of an oscillating wind blowing backwards and forwards, it produces a result of &amp;lt;math&amp;gt;\tfrac{\pi}{2}&amp;lt;/math&amp;gt; radians, i.e. a [[right angle]].  The final factor adjusts this figure upwards so that it produces the double-pass result of &amp;lt;math&amp;gt;\tfrac{\pi}{\sqrt{3}}&amp;lt;/math&amp;gt; radians for an almost uniform distribution of angles across all directions, while making minimal change to results for small dispersions. &lt;br /&gt;
&lt;br /&gt;
The theoretical maximum error against the correct double-pass σ&amp;lt;sub&amp;gt;θ&amp;lt;/sub&amp;gt; is therefore about 15% with an oscillating wind. Comparisons against Monte Carlo generated cases indicate that Yamartino&amp;#039;s algorithm is within 2% for more realistic distributions.&lt;br /&gt;
&lt;br /&gt;
A variant might be to weight each wind direction observation by the wind speed at that time.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Algorithms for calculating variance]]&lt;br /&gt;
* [[Directional statistics]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
{{reflist}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Statistical algorithms]]&lt;br /&gt;
[[Category:Boundary layer meteorology]]&lt;br /&gt;
[[Category:Atmospheric dispersion modeling]]&lt;br /&gt;
[[Category:Directional statistics]]&lt;/div&gt;</summary>
		<author><name>en&gt;K6ka</name></author>
	</entry>
</feed>