pub trait ContinuousCdf {
type Error;
// Required methods
fn cdf(&self, x: f64) -> f64;
fn ccdf(&self, x: f64) -> f64;
fn inverse_cdf(&self, p: f64) -> Result<f64, Self::Error>;
}Expand description
Cumulative distribution function (CDF), complementary CDF, and inverse CDF for a continuous distribution.
§Example
use cdflib::Normal;
use cdflib::traits::ContinuousCdf;
let n = Normal::new(0.0, 1.0);
let p = n.cdf(0.0); // 0.5
let x = n.inverse_cdf(p).unwrap(); // 0.0Required Associated Types§
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".