Boost logo

Boost Users :

Subject: [Boost-users] Boost.Random question
From: gast128 (gast128_at_[hidden])
Date: 2010-03-08 14:29:56


Hello all,

a colleague of my asked me to drop a question on the forum about the following
case:

He produces 1000 samples with the following code:

boost::normal_distribution<double> n1(1, sqrt(4.0));
boost::variate_generator< boost::minstd_rand,
boost::normal_distribution<double> > g1(boost::minstd_rand(), n1);

He also calulates the covariance. It should be something like (4 0) but he
got (4.1 8.3). This 4 is correct, but the 8.3 not. Anyone an idea?

Note (again): post from a colleague; i didn't try it myself.


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