Class prob_dens_hist (o2scl)

O2scl : Class List

class o2scl::prob_dens_hist : public o2scl::prob_dens_frange

Probability density function based on a histogram.

Note

This class is experimental.

Public Types

typedef boost::numeric::ublas::vector<double> ubvector

Public Functions

prob_dens_hist()
~prob_dens_hist()
void init(hist &h)

Initialize with histogram h.

const ubvector &partial_sums()

Get reference to partial sums.

const ubvector &bin_ranges()

Get reference to bin ranges.

double operator()() const

Generate a sample.

double lower_limit() const

Lower limit of the range.

double upper_limit() const

Uower limit of the range.

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

Cumulative distribution function (from the lower tail)

double invert_cdf(double x) const

Inverse cumulative distribution function (from the lower tail)

double entropy() const

Entropy of the distribution ( \( - \int f \ln f \) )

Protected Attributes

search_vec<ubvector> sv

Search through the partial sums.

size_t n

Number of original histogram bins.

ubvector sum

Normalized partial sum of histogram bins.

This vector has size n plus one.

ubvector range

Vector specifying original histogram bins.

This vector has size n plus one.

rng_gsl rng

Random number generator.