All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes
o2scl::prob_dens_lognormal Class Reference

Lognormal density function. More...

Detailed Description

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.

Definition at line 421 of file prob_dens_func.h.

#include <prob_dens_func.h>

Inheritance diagram for o2scl::prob_dens_lognormal:
o2scl::prob_dens_positive o2scl::prob_dens_func

Public Member 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 parameter sigma. More...
 
 prob_dens_lognormal (const prob_dens_lognormal &pdg)
 Copy constructor.
 
prob_dens_lognormaloperator= (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.
 
virtual double sample () const
 Sample from the specified density.
 
virtual double operator() (double x) const
 The normalized density.
 
virtual double cdf (double x) const
 The cumulative distribution function (from the lower tail)
 
virtual double invert_cdf (double in_cdf) const
 The inverse cumulative distribution function.
 
virtual double entropy () const
 The inverse cumulative distribution function.
 

Protected Attributes

double sigma_
 Width parameter. More...
 
double mu_
 Central value. More...
 
gsl_rng * r
 The GSL random number generator.
 

Constructor & Destructor Documentation

o2scl::prob_dens_lognormal::prob_dens_lognormal ( double  mu,
double  sigma 
)
inline

The value of sigma must be larger than zero.

Definition at line 455 of file prob_dens_func.h.

Field Documentation

double o2scl::prob_dens_lognormal::mu_
protected

A value of -1 indicates it is yet unspecified.

Definition at line 435 of file prob_dens_func.h.

double o2scl::prob_dens_lognormal::sigma_
protected

A value of -1 indicates it is yet unspecified.

Definition at line 429 of file prob_dens_func.h.


The documentation for this class was generated from the following file:

Documentation generated with Doxygen. Provided under the GNU Free Documentation License (see License Information).
Hosted at Get Object-oriented Scientific Computing
Lib at SourceForge.net. Fast, secure and Free Open Source software
downloads..