How to use boost normal distribution classes?

后端 未结 2 1031
一整个雨季
一整个雨季 2020-12-12 17:56

I\'m trying to use boost::normal_distribution in order to generate a normal distribution with mean 0 and sigma 1.

The following code doesn\'t work as some values are

2条回答
  •  既然无缘
    2020-12-12 17:57

    You're not doing anything wrong. For a normal distribution, sigma specifies the standard deviation, not the range. If you generate enough samples, you will see that only about 68% of them lie in the range [mean - sigma, mean + sigma], about 95% within 2 sigma, and more than 99% within 3 sigma.

提交回复
热议问题