[−][src]Trait peroxide::statistics::stat::Statistics
Statistics Trait
It contains mean
, var
, sd
, cov
Associated Types
Loading content...Required methods
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
Implementations on Foreign Types
impl Statistics for Vec<f64>
[src]
type Array = Vec<f64>
type Value = f64
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]
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); }
fn sd(&self) -> f64
[src]
Standard Deviation
Examples
#[macro_use] extern crate peroxide; use peroxide::fuga::*; fn main() { let a = c!(1,2,3); assert!(nearly_eq(a.sd(), 1f64)); // Floating Number Error }
fn cov(&self) -> Vec<f64>
[src]
fn cor(&self) -> Vec<f64>
[src]
Implementors
impl Statistics for Matrix
[src]
type Array = Matrix
type Value = Vec<f64>
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]
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]
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)); }
fn cov(&self) -> Self
[src]
Covariance Matrix (Column based)
Examples
#[macro_use] extern crate peroxide; use peroxide::fuga::*; fn main() { let m = matrix(c!(1,2,3,3,2,1), 3, 2, Col); println!("{}", m.cov()); // c[0] c[1] // r[0] 1.0000 -1.0000 // r[1] -1.0000 1.0000 }