I'm looking for a function implementation (or library) in C++ that could calculate the value of the inverse of the cumulative function of a lognormal distribution. I had no luck finding it.
Any help would be hugely appreciated!
GNU Scientific Library can do that, and it's a plain C library available on pretty much any system. From the documentation:
- Function:
double gsl_cdf_lognormal_P (double x, double zeta, double sigma)
- Function:
double gsl_cdf_lognormal_Q (double x, double zeta, double sigma)
- Function:
double gsl_cdf_lognormal_Pinv (double P, double zeta, double sigma)
Function:
double gsl_cdf_lognormal_Qinv (double Q, double zeta, double sigma)
These functions compute the cumulative distribution functions P(x), Q(x) and their inverses for the lognormal distribution with parameters zeta and sigma.
The Numerical Recipes 3rd edition has a section on this. You can read 30 pages per month for free and unlimited when you subsribe here. The lognormal distribution is discussed in section 6.14.7 page 328.