Class prob_dens_lognormal (o2scl)¶
-
class prob_dens_lognormal : public o2scl::prob_dens_positive¶
Lognormal density function.
The distribution
\[ P(x)=\frac{1}{x \sigma \sqrt{2 \pi}} \exp \left[-\frac{\left(\ln x-\mu\right)^2}{2\sigma^2}\right] \]This class is experimental.
Public Functions
-
inline prob_dens_lognormal()¶
Create a blank lognormal distribution.
-
inline prob_dens_lognormal(double mu, double sigma)¶
Create lognormal distribution with mean parameter
mu
and width parametersigma
.The value of
sigma
must be larger than zero.
-
inline virtual ~prob_dens_lognormal()¶
-
inline prob_dens_lognormal(const prob_dens_lognormal &pdg)¶
Copy constructor.
-
inline prob_dens_lognormal &operator=(const prob_dens_lognormal &pdg)¶
Copy constructor with operator=.
-
inline void set_mu_sigma(double mu, double sigma)¶
Set the maximum and width of the lognormal distribution.
-
inline void set_seed(unsigned long int s)¶
Set the seed.
-
inline virtual double operator()() const¶
Sample from the specified density.
-
inline virtual double pdf(double x) const¶
The normalized density.
-
inline virtual double log_pdf(double x) const¶
The log of the normalized density.
-
inline virtual double cdf(double x) const¶
The cumulative distribution function (from the lower tail)
-
inline virtual double invert_cdf(double in_cdf) const¶
The inverse cumulative distribution function.
-
inline virtual double entropy() const¶
Entropy of the distribution ( \( - \int f \ln f \) )
-
inline prob_dens_lognormal()¶