Re: [Boost-users] covariance calculus via boost::accumulators

Hi All
I would like to calculate the covariance of 2 variables.
I found that in Boost there is boost::accumulators and the
Statistical Accumulators Library that looks good to me.
Covariance is a measure of how much two variables
change together, but in the example given by boost ( I am guessing)
I see only an example for one variable.
I did not really understand how to setup the accumulators for 2 or
more variables.
What role plays the covariate here and where to pick up or feed the
values for the second variable?
Thanks to all
accumulator_set

On Mon, Nov 23, 2009 at 8:33 AM, Conoscenza Silente < abruzzoforteegentile@gmail.com> wrote:
I would like to calculate the covariance of 2 variables.
I did not really understand how to setup the accumulators for 2 or more variables.
What role plays the covariate here and where to pick up or feed the values for the second variable?
I'm not sure if it accomplishes exactly what you want, but the attached sample may be useful. It is a little program to compute some stats from an input file. It includes covariance details. It uses autoconf and assumes you're on a un*x-ish system or Cygwin, so you'll want to use ./bootstrap && ./configure && make. The file you're after is src/stat.cc. - Rhys

hi Rhys!
Thank you very much for your code!
CS
On Wed, Nov 25, 2009 at 7:12 PM, Rhys Ulerich
On Mon, Nov 23, 2009 at 8:33 AM, Conoscenza Silente
wrote: I would like to calculate the covariance of 2 variables.
I did not really understand how to setup the accumulators for 2 or more variables.
What role plays the covariate here and where to pick up or feed the values for the second variable?
I'm not sure if it accomplishes exactly what you want, but the attached sample may be useful. It is a little program to compute some stats from an input file. It includes covariance details. It uses autoconf and assumes you're on a un*x-ish system or Cygwin, so you'll want to use ./bootstrap && ./configure && make. The file you're after is src/stat.cc. - Rhys
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Conoscenza Silente
-
Rhys Ulerich