use crate::rng;
pub mod bernoulli;
pub mod beta;
pub mod binomial;
pub mod chisquared;
pub mod exponential;
pub mod gamma;
pub mod geometric;
pub mod lognormal;
pub mod normal;
pub mod poisson;
pub mod uniform;
pub trait Moments {
fn mean(&self) -> f64;
fn variance(&self) -> f64;
fn std_dev(&self) -> f64 {
self.variance().sqrt()
}
fn skewness(&self) -> f64;
fn kurtosis(&self) -> f64;
fn kurtosis_full(&self) -> f64 { self.kurtosis() + 3.0 }
fn entropy(&self) -> f64;
}
pub trait Distribution {
type Value;
fn cdf(&self, x: Self::Value) -> f64;
fn sample<R: rng::RngCore>(&self, rng: &mut R) -> Self::Value;
fn in_support(&self, x: Self::Value) -> bool;
}
pub trait Continuous: Distribution<Value = f64> {
fn pdf(&self, x: f64) -> f64;
fn inv_cdf(&self, p: f64) -> f64;
}
pub trait Discrete: Distribution<Value = i64> {
fn pmf(&self, x: Self::Value) -> f64;
fn inv_cdf(&self, p: f64) -> Self::Value;
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum DistError {
InvalidParameter,
}