我对 C++ 和 boost 还很陌生。
我想使用 Boost 的 skewed_normal_distribution
类创建一组从偏态分布派生的数字。
我什至不确定如何开始。我想定义一个均值为 0.05、方差为 0.95、偏斜为 0.5 的分布。以下代码不起作用,我意识到我还需要设置一个 variate_generator
。
谁能指点一下?我没有发现 skew_normal_distribution
上的 boost 文档页面非常直观,但这可能是因为我缺乏经验。
注意我收到的主要问题是消息:
“skew_normal_distribution
”不是“boost
”的成员
非常感谢
#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;
}
最佳答案
使用 boost::math::skew_normal_distribution
代替 boost::skew_normal_distribution
skew_normal_distribution
is not a member ofboost
关于c++ - 使用 boost 的 skewed_normal_distribution,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38185604/