pub struct FDistribution {
pub d1: f64,
pub d2: f64,
}Expand description
F-distribution F(d1, d2).
§Examples
use rs_stats::distributions::f_distribution::FDistribution;
use rs_stats::distributions::traits::Distribution;
let f = FDistribution::new(5.0, 10.0).unwrap();
assert!((f.mean() - 10.0 / 8.0).abs() < 1e-10);Fields§
§d1: f64Numerator degrees of freedom d1 > 0
d2: f64Denominator degrees of freedom d2 > 0
Implementations§
Source§impl FDistribution
impl FDistribution
Sourcepub fn new(d1: f64, d2: f64) -> StatsResult<Self>
pub fn new(d1: f64, d2: f64) -> StatsResult<Self>
Creates an F(d1, d2) distribution.
Sourcepub fn fit(data: &[f64]) -> StatsResult<Self>
pub fn fit(data: &[f64]) -> StatsResult<Self>
Method-of-moments fitting from data > 0.
Estimates d2 from the mean (requires mean > 1) and d1 from the variance.
Trait Implementations§
Source§impl Clone for FDistribution
impl Clone for FDistribution
Source§fn clone(&self) -> FDistribution
fn clone(&self) -> FDistribution
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FDistribution
impl Debug for FDistribution
Source§impl Distribution for FDistribution
impl Distribution for FDistribution
Source§fn num_params(&self) -> usize
fn num_params(&self) -> usize
Number of free parameters (used when computing AIC / BIC).
Source§fn inverse_cdf(&self, p: f64) -> StatsResult<f64>
fn inverse_cdf(&self, p: f64) -> StatsResult<f64>
Quantile (inverse CDF): find x such that F(x) = p.
Source§fn log_likelihood(&self, data: &[f64]) -> StatsResult<f64>
fn log_likelihood(&self, data: &[f64]) -> StatsResult<f64>
Sum of log-likelihoods: Σ ln f(xᵢ).
impl Copy for FDistribution
Auto Trait Implementations§
impl Freeze for FDistribution
impl RefUnwindSafe for FDistribution
impl Send for FDistribution
impl Sync for FDistribution
impl Unpin for FDistribution
impl UnsafeUnpin for FDistribution
impl UnwindSafe for FDistribution
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more