Trait peroxide::statistics::stat::Statistics [−][src]
pub trait Statistics { type Array; type Value; fn mean(&self) -> Self::Value; fn var(&self) -> Self::Value; fn sd(&self) -> Self::Value; fn cov(&self) -> Self::Array; fn cor(&self) -> Self::Array; }
Expand description
Statistics Trait
It contains mean
, var
, sd
, cov
Associated Types
Required methods
Implementations on Foreign Types
impl Statistics for Vec<f64>
[src]
impl Statistics for Vec<f64>
[src]fn mean(&self) -> f64
[src]
fn mean(&self) -> f64
[src]Mean
Examples
#[macro_use] extern crate peroxide; use peroxide::fuga::*; fn main() { let a = c!(1,2,3,4,5); assert_eq!(a.mean(), 3.0); }
fn var(&self) -> f64
[src]
fn var(&self) -> f64
[src]Variance
Examples
#[macro_use] extern crate peroxide; use peroxide::fuga::*; fn main() { let a = c!(1,2,3,4,5); assert_eq!(a.var(), 2.5); }
Implementors
impl Statistics for Matrix
[src]
impl Statistics for Matrix
[src]fn mean(&self) -> Vec<f64>
[src]
fn mean(&self) -> Vec<f64>
[src]Column Mean
Examples
#[macro_use] extern crate peroxide; use peroxide::fuga::*; fn main() { let m = matrix(c!(1,3,3,1), 2, 2, Col); assert_eq!(m.mean(), c!(2,2)); }
fn var(&self) -> Vec<f64>
[src]
fn var(&self) -> Vec<f64>
[src]Column variance
Examples
#[macro_use] extern crate peroxide; use peroxide::fuga::*; fn main() { let m = matrix(c!(1,2,3,3,2,1), 3, 2, Col); assert!(nearly_eq(m.var()[0], 1)); }
fn sd(&self) -> Vec<f64>
[src]
fn sd(&self) -> Vec<f64>
[src]Column Standard Deviation
Examples
#[macro_use] extern crate peroxide; use peroxide::fuga::*; fn main() { let m = matrix(c!(1,2,3,3,2,1), 3, 2, Col); assert!(nearly_eq(m.sd()[0], 1)); }
impl<T: PartialOrd + SampleUniform + Copy + Into<f64>> Statistics for OPDist<T>
[src]
impl<T: PartialOrd + SampleUniform + Copy + Into<f64>> Statistics for OPDist<T>
[src]