Struct bio::stats::probs::cdf::CDF

source ·
pub struct CDF<T: Ord> { /* private fields */ }
Expand description

Implementation of a cumulative distribution function.

Implementations

Create CDF from given probability mass function (PMF). The PMF may contain duplicate values the probabilities of which are summed during generation of the CDF.

Arguments
  • pmf - the PMF as a vector of Entry objects

Create CDF from iterator. This can be used to replace the values of a CDF.

Reduce CDF by omitting values with zero probability.

Downsample CDF to n entries. Panics if n <= 1 and returns identity if n is greater than the number of entries.

Provide iterator.

Mutable iterator over entries. This does not check for consistency. In other words, you should not change the order of the entries, nor the probabilities!

Iterator over corresponding PMF.

Get cumulative probability for a given value. If the value is not present, return the probability of the previous value. Complexity O(log n).

Get probability (i.e. probability mass) for a given value. Complexity O(log n).

Return total probability.

Return maximum a posteriori probability estimate (MAP).

Return w%-credible interval. The width w is a float between 0 and 1. Panics otherwise. E.g. provide width=0.95 for the 95% credible interval.

Number of entries in the CDF.

Calculate expected value.

Calculate variance.

Calculate standard deviation.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.