pub struct FDist {
pub nu1: f64,
pub nu2: f64,
}Expand description
Struct for the F distribution X ~ F(nu1, nu2).
§Parameters
nu1 > 0nu2 > 0
§Support
x > 0
§Example
Suppose X ~ F(nu1=4.0, nu2=18.0). Use.
use ruststat::FDist;
let mut myf = FDist{nu1:4.0, nu2:18.0};
println!("Probability density function f(2.5): {}", myf.pdf(2.5));
println!("Cumulative distribution function P(X<=2.5): {}", myf.cdf(2.5));
println!("99th percentile: {}", myf.per(0.99));
println!("Random draw: {}", myf.ran());
println!("Random vector: {:?}", myf.ranvec(5));
println!("Mean: {}", myf.mean());
println!("Variance: {}", myf.var());
println!("Standard deviation: {}", myf.sd());Fields§
§nu1: f64§nu2: f64Implementations§
Source§impl FDist
impl FDist
pub fn pdf(&mut self, x: f64) -> f64
pub fn cdf(&mut self, x: f64) -> f64
pub fn per(&mut self, x: f64) -> f64
pub fn ran(&mut self) -> f64
pub fn ranvec(&mut self, n: u64) -> Vec<f64>
pub fn mean(&mut self) -> f64
pub fn var(&mut self) -> f64
pub fn sd(&mut self) -> f64
Auto Trait Implementations§
impl Freeze for FDist
impl RefUnwindSafe for FDist
impl Send for FDist
impl Sync for FDist
impl Unpin for FDist
impl UnsafeUnpin for FDist
impl UnwindSafe for FDist
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