What are the right includes for using the boost accumulators library?
<p>I'm trying to compile <a href="http://boost-sandbox.sourceforge.net/libs/accumulators/doc/html/accumulators/user%5Fs%5Fguide/the%5Fstatistical%5Faccumulators%5Flibrary.html#accumulators.user%5Fs%5Fguide.the%5Fstatistical%5Faccumulators%5Flibrary.weighted%5Fp%5Fsquare%5Fcumulative%5Fdistribution" rel="nofollow">this example</a></p>

<p>But that one header isn't enough and I've already spent half an hour trying to clobber all of the errors.  Why aren't the required includes specified?</p>

<p>I did this:</p>

<pre><code>#include &lt;boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp&gt;
#include &lt;vector&gt;
#include &lt;boost/accumulators/accumulators.hpp&gt; 
#include &lt;boost/test/test_tools.hpp&gt;
#include &lt;boost/random/lagged_fibonacci.hpp&gt;
#include &lt;boost/random/normal_distribution.hpp&gt;
#include &lt;boost/random/variate_generator.hpp&gt;
#include &lt;boost/range/iterator_range.hpp&gt;
#include &lt;boost/fusion/support/void.hpp&gt;
#include &lt;boost/accumulators/framework/depends_on.hpp&gt;

using namespace boost::accumulators;
using namespace boost;

int main() {
    // tolerance in %
    double epsilon = 4;

    typedef accumulator_set&lt;double, stats&lt;tag::weighted_p_square_cumulative_distribution&gt;, double &gt; accumulator_t;

    accumulator_t acc_upper(tag::weighted_p_square_cumulative_distribution::num_cells = 100);
    accumulator_t acc_lower(tag::weighted_p_square_cumulative_distribution::num_cells = 100);

    // two random number generators
    double mu_upper = 1.0;
    double mu_lower = -1.0;
    boost::lagged_fibonacci607 rng;
    boost::normal_distribution&lt;&gt; mean_sigma_upper(mu_upper,1);
    boost::normal_distribution&lt;&gt; mean_sigma_lower(mu_lower,1);
    boost::variate_generator&lt;boost::lagged_fibonacci607&amp;, boost::normal_distribution&lt;&gt; &gt; normal_upper(rng, mean_sigma_upper);
    boost::variate_generator&lt;boost::lagged_fibonacci607&amp;, boost::normal_distribution&lt;&gt; &gt; normal_lower(rng, mean_sigma_lower);

    for (std::size_t i=0; i&lt;100000; ++i)
    {
     double sample = normal_upper();
     acc_upper(sample, weight = std::exp(-mu_upper * (sample - 0.5 * mu_upper)));
    }

    for (std::size_t i=0; i&lt;100000; ++i)
    {
     double sample = normal_lower();
     acc_lower(sample, weight = std::exp(-mu_lower * (sample - 0.5 * mu_lower)));
    }

    typedef iterator_range&lt;std::vector&lt;std::pair&lt;double, double&gt; &gt;::iterator &gt; histogram_type;
    histogram_type histogram_upper = weighted_p_square_cumulative_distribution(acc_upper);
    histogram_type histogram_lower = weighted_p_square_cumulative_distribution(acc_lower);

    // Note that applaying importance sampling results in a region of the distribution 
    // to be estimated more accurately and another region to be estimated less accurately
    // than without importance sampling, i.e., with unweighted samples

    for (std::size_t i = 0; i &lt; histogram_upper.size(); ++i)
    {
     // problem with small results: epsilon is relative (in percent), not absolute!

     // check upper region of distribution
     if ( histogram_upper[i].second &gt; 0.1 )    
      BOOST_CHECK_CLOSE( 0.5 * (1.0 + erf( histogram_upper[i].first / sqrt(2.0) )), histogram_upper[i].second, epsilon );
     // check lower region of distribution
     if ( histogram_lower[i].second &lt; -0.1 )    
      BOOST_CHECK_CLOSE( 0.5 * (1.0 + erf( histogram_lower[i].first / sqrt(2.0) )), histogram_lower[i].second, epsilon );
    }
}
</code></pre>

<p>And I got these errors:</p>

<pre><code>In file included from /opt/local/include/boost/accumulators/statistics/weighted_p_square_cumulative_distribution.hpp:17,
                 from a.cc:1:
/opt/local/include/boost/accumulators/framework/extractor.hpp: In instantiation of 'boost::accumulators::detail::accumulator_set_result&lt;boost::accumulators::accumulator_set&lt;double, boost::accumulators::stats&lt;boost::accumulators::tag::weighted_p_square_cumulative_distribution, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na&gt;, double&gt;, boost::accumulators::tag::weighted_p_square_cumulative_distribution&gt;':
/opt/local/include/boost/mpl/eval_if.hpp:38:   instantiated from 'boost::mpl::eval_if&lt;boost::accumulators::detail::is_accumulator_set&lt;boost::accumulators::accumulator_set&lt;double, boost::accumulators::stats&lt;boost::accumulators::tag::weighted_p_square_cumulative_distribution, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na&gt;, double&gt; &gt;, boost::accumulators::detail::accumulator_set_result&lt;boost::accumulators::accumulator_set&lt;double, boost::accumulators::stats&lt;boost::accumulators::tag::weighted_p_square_cumulative_distribution, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na&gt;, double&gt;, boost::accumulators::tag::weighted_p_square_cumulative_distribution&gt;, boost::accumulators::detail::argument_pack_result&lt;boost::accumulators::accumulator_set&lt;double, boost::accumulators::stats&lt;boost::accumulators::tag::weighted_p_square_cumulative_distribution, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na&gt;, double&gt;, boost::accumulators::tag::weighted_p_square_cumulative_distribution&gt; &gt;'
/opt/local/include/boost/accumulators/framework/extractor.hpp:57:   instantiated from 'boost::accumulators::detail::extractor_result&lt;boost::accumulators::accumulator_set&lt;double, boost::accumulators::stats&lt;boost::accumulators::tag::weighted_p_square_cumulative_distribution, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na, mpl_::na&gt;, double&gt;, boost::accumulators::tag::weighted_p_square_cumulative_distribution&gt;'
a.cc:47:   instantiated from here
/opt/local/include/boost/accumulators/framework/extractor.hpp:36: error: no type named 'result_type' in 'struct boost::fusion::void_'
a.cc: In function 'int main()':
a.cc:47: error: no match for call to '(const boost::accumulators::extractor&lt;boost::accumulators::tag::weighted_p_square_cumulative_distribution&gt;) (main()::accumulator_t&amp;)'
a.cc:48: error: no match for call to '(const boost::accumulators::extractor&lt;boost::accumulators::tag::weighted_p_square_cumulative_distribution&gt;) (main()::accumulator_t&amp;)'
</code></pre>
