2

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!

Naucle
  • 626
  • 12
  • 28

2 Answers2

1

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.

kfx
  • 8,136
  • 3
  • 28
  • 52
  • Exactly what I needed, thank you. EDIT : By the way, I found out that the Boost library can do that too (these inverse cumulative functions are actually also called "quantile functions", which I didn't know.) – Naucle Feb 27 '15 at 18:22
0

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.

463035818_is_not_an_ai
  • 109,796
  • 11
  • 89
  • 185