c++ - 逆高斯分布c ++
问题描述
我想用 C++ 做一个程序,可以得到一个数字的逆高斯分布,就像NORM.S.INV
在 Excel 中一样:
=NORM.S.INV(0.95) -> 1.644853627
问题是我不知道如何使用 boost 包来做到这一点。我厌倦了下面的程序:
#include <boost/math/distributions/inverse_gaussian.hpp>
#include <iostream>
int main() {
std::cout << "Hello world" << std::endl;
using boost::math::inverse_gaussian;
double Inverse = inverse_gaussian my_ig(2, 3);
std::cout << Inverse;
return 0;
}
但它给了我error: expected primary-expression before 'my_ig'
。有谁知道我做错了什么?
解决方案
我认为 inverse_gaussian costructor 不能返回双精度...例如此代码有效。
inverse_gaussian my_ig(2, 3);
std::cout << my_ig.mean();
推荐阅读
- nestjs - 将 webpack 与 hotreload 连接后,nestjs 渲染错误
- r - Markdown 在第一个 Chunk 后未编译(到达 html 抓取时停止)
- python - 如何在 django 中编写带有分页的单元测试
- node.js - amqp client doesn't show that RabbitMQ server connection is blocked
- reactjs - Material UI 主题全局 Dense 设置
- azure-data-factory - 在数据工厂中参数化多个 CSV 文件的负载的最佳实践
- google-apps-script - GmailApp(Google Apps 脚本)将内联图像显示为附件
- python - 修改绘图轴,使其刻度标签的顺序和它们各自的点相应改变 - 不修改数据本身
- apache-nifi - 在目标表中使用具有不同列名的 PutDatabaseRecord 迁移表
- asp.net - xamarin 表单中的登录概念