What is the C++ equivalent of python's stats.norm.ppf(probability)? Are there built-in c++ functions for it, or can you call python functions from C++?
Is boost the only way to do it? but I am trouble installing boost.
What is the C++ equivalent of python's stats.norm.ppf(probability)? Are there built-in c++ functions for it, or can you call python functions from C++?
Is boost the only way to do it? but I am trouble installing boost.
Copyright © 2021 Jogjafile Inc.
The error function is implemented in the C++ standard library as
std::erfin<cmath>. However, the inverse error function, which is essentially what you want here, is not implemented in the standard library.You need to use some third-party library that implements it. Whether that is boost or any other one of course doesn't matter.
There are also going to be general statistics libraries that implement the distribution functions directly for different distributions.
That is no different than in Python.
scipy.stats.norm.ppfis also not part of the Python standard library that comes with a Python installation. It is part of the SciPy library.However, generally the C++ standard library is much narrower in scope than the Python one.
(Alternatively you can of course implement the function yourself.)
Recommendations for specific libraries are off-topic here.