Using boost's skewed_normal_distribution

爷,独闯天下 提交于 2019-12-11 04:25:24

问题


I am fairly new to c++ and boost.

I want to create a set of numbers that derived from a skewed distribution using Boost's skewed_normal_distribution class.

I'm not sure how to even start. I want to define a distribution with mean 0.05, variance 0.95, but a skew of 0.5. The following code doesn't work and I realise I need to set up a variate_generator as well.

Can anyone provide some pointers? I am not finding the boost documentation page on skew_normal_distribution very intuitive but that might be because of my inexperience.

Note the main problem I am getting is the message:

skew_normal_distribution’ is not a member of ‘boost

Many thanks

#include <boost/random.hpp>
#include <boost/random/normal_distribution.hpp>

#include <boost/math/distributions/skew_normal.hpp>

int main () {
    boost::skew_normal_distribution<> normal(0.05, 0.95, 0.5);
    return 0;
}

回答1:


Use boost::math::skew_normal_distribution instead of boost::skew_normal_distribution for the message

skew_normal_distribution is not a member of boost



来源:https://stackoverflow.com/questions/38185604/using-boosts-skewed-normal-distribution

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!