Class prob_dens_lognormal (o2scl)¶
-
class
o2scl
::
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
-
prob_dens_lognormal
()¶ Create a blank lognormal distribution.
-
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.
-
~prob_dens_lognormal
()¶
-
prob_dens_lognormal
(const prob_dens_lognormal &pdg)¶ Copy constructor.
-
prob_dens_lognormal &
operator=
(const prob_dens_lognormal &pdg)¶ Copy constructor with operator=.
-
void
set_mu_sigma
(double mu, double sigma)¶ Set the maximum and width of the lognormal distribution.
-
void
set_seed
(unsigned long int s)¶ Set the seed.
-
double
operator()
() const¶ Sample from the specified density.
-
double
pdf
(double x) const¶ The normalized density.
-
double
log_pdf
(double x) const¶ The log of the normalized density.
-
double
cdf
(double x) const¶ The cumulative distribution function (from the lower tail)
-
double
invert_cdf
(double in_cdf) const¶ The inverse cumulative distribution function.
-
double
entropy
() const¶ Entropy of the distribution ( \( - \int f \ln f \) )
-