Boost C++ Libraries: Ticket #7150: What effect does the mean tag have on variance https://svn.boost.org/trac10/ticket/7150 <p> typedef accumulator_set&lt;double, stats&lt;tag::variance&gt; &gt; Var; typedef accumulator_set&lt;double, stats&lt;tag::variance, tag::mean&gt; &gt; <a class="missing wiki">VarMean</a>; </p> <p> Each of these constructs results in a different variance result. It is my understanding that they should be the same. Could you please tell me what I am missing? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7150 Trac 1.4.3 colmearley@… Thu, 19 Jul 2012 01:19:53 GMT attachment set https://svn.boost.org/trac10/ticket/7150 https://svn.boost.org/trac10/ticket/7150 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">TestVar.cpp</span> </li> </ul> <p> Test program for variance </p> Ticket Eric Niebler Thu, 19 Jul 2012 01:35:04 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7150#comment:1 https://svn.boost.org/trac10/ticket/7150#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> The <a href="http://www.boost.org/doc/libs/1_50_0/doc/html/accumulators/user_s_guide.html#accumulators.user_s_guide.the_statistical_accumulators_library.variance">docs</a> make a distinction between <code>variance</code> and <code>lazy_variance</code>, the former depends on <code>count</code> and <code>immediate_mean</code>, the latter on <code>moment&lt;2&gt;</code> and <code>mean</code>. By telling <code>variance</code> to depend instead on <code>mean</code>, you've changed how the computation is done. You now have a very strange variance accumulator that is neither fully immediate nor fully lazy. </p> <p> In short: don't do that. :-) </p> Ticket Colm Earley <colmearley@…> Thu, 19 Jul 2012 02:21:57 GMT status changed; resolution deleted https://svn.boost.org/trac10/ticket/7150#comment:2 https://svn.boost.org/trac10/ticket/7150#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">closed</span> → <span class="trac-field-new">reopened</span> </li> <li><strong>resolution</strong> <span class="trac-field-deleted">invalid</span> </li> </ul> <p> Thanks Eric. Does this mean that accumulators can only calculate one value at a time? Say I wanted to calculate mean, variance and kurtosis, would I need separate accumulators to avoid overwriting the dependencies? </p> <p> This is what I initially expected to work: typedef accumulator_set&lt;double, stats&lt;tag::mean, tag::variance, tag::kurtosis&gt; &gt; stats; </p> <p> </p> Ticket Eric Niebler Thu, 19 Jul 2012 02:26:31 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7150#comment:3 https://svn.boost.org/trac10/ticket/7150#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">reopened</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">invalid</span> </li> </ul> <p> Just use <code>tag::immediate_mean</code> instead of <code>tag::mean</code>. Please don't reopen this ticket. There isn't a bug here. If you have any further questions, please send them to the boost mailing list. Thanks. </p> Ticket