Class prob_dens_func (o2scl)¶
-
class
o2scl
::
prob_dens_func
¶ A one-dimensional probability density function.
This class is experimental.
- Idea for Future:
Give functions for mean, median, mode, variance, etc?
Subclassed by o2scl::prob_dens_frange, o2scl::prob_dens_gaussian, o2scl::prob_dens_positive
Public Functions
-
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 cdf) const¶ The inverse cumulative distribution function.
-
double
entropy
() const¶ Entropy of the distribution ( \( - \int f \ln f \) )