pub trait Continuous<K, T> {
    fn pdf(&self, x: K) -> T;
    fn ln_pdf(&self, x: K) -> T;
}
Expand description

The Continuous trait provides an interface for interacting with continuous statistical distributions

Remarks

All methods provided by the Continuous trait are unchecked, meaning they can panic if in an invalid state or encountering invalid input depending on the implementing distribution.

Required Methods

Returns the probability density function calculated at x for a given distribution. May panic depending on the implementor.

Examples
use statrs::distribution::{Continuous, Uniform};

let n = Uniform::new(0.0, 1.0).unwrap();
assert_eq!(1.0, n.pdf(0.5));

Returns the log of the probability density function calculated at x for a given distribution. May panic depending on the implementor.

Examples
use statrs::distribution::{Continuous, Uniform};

let n = Uniform::new(0.0, 1.0).unwrap();
assert_eq!(0.0, n.ln_pdf(0.5));

Implementors