In the docs
(file:///C:/Libraries/boost/boost_1_39_0/doc/html/accumulators/user_s_guide.htm
l#accumulators.user_s_guide.the_statistical_accumulators_library.variance)
there is an example of calculating variance of values 1,2,3,4,5
accumulator_settag::variance(lazy) > acc1;
acc1(1);
acc1(2);
acc1(3);
acc1(4);
acc1(5);
BOOST_CHECK_EQUAL(5u, count(acc1));
BOOST_CHECK_CLOSE(3., mean(acc1), 1e-5);
BOOST_CHECK_CLOSE(11., moment<2>(acc1), 1e-5);
BOOST_CHECK_CLOSE(2., variance(acc1), 1e-5);
When I am doing the same in Excel the mean is indeed 3, which matches the
example, but variance is 2.5 and not 2. I am using AVERAGE and VAR formulas in
Excel for mean and variance respectively
Why there is a mismatch between variance values??