Boost logo

Boost Users :

Subject: [Boost-users] Statistical Accumulator
From: Kraus Philipp (philipp.kraus_at_[hidden])
Date: 2010-07-06 16:31:00


Hi,

I try to calulate the covariance from some data.

  http://www.boost.org/doc/libs/1_43_0/doc/html/accumulators/user_s_guide.html#accumulators.user_s_guide.the_statistical_accumulators_library.covariance

I don't understand the call "acc call". I would like to rebuild the
cov command form Matlab for matrix data (http://www.mathworks.com/access/helpdesk/help/techdoc/ref/cov.html
).
If this is correct, when I give as the first argument of command data
from the first line and second as the data of the first column to the
first value to calculate the new matrix?

I try try compile the excample, but I get a compiler error on the
"acc::tag::covariate1":

     acc::accumulator_set<double,
acc::stats<acc::tag::covariance<double, acc::tag::covariate1> > > xx;

     xx(1., acc::tag::covariate1 = 2.);
     xx(1., acc::tag::covariate1 = 4.);
     xx(2., acc::tag::covariate1 = 3.);
     xx(6., acc::tag::covariate1 = 1.);

     std::cout << acc::covariance(xx) << std::endl;

The error text: "expected primary-expression befor = token". Sorry,
it's a little bit late, so I don't see my mistake

Thanks Phil



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net