StatsExt

Trait StatsExt 

Source
pub trait StatsExt {
    // Required methods
    fn mean(&self) -> Option<f64>;
    fn standard_deviation(&self, ddof: f64) -> f64;
}
Expand description

Trait extension for Array1 to calculate mean and standard deviation

This trait provides statistical methods for ndarray’s ArrayView1 type, enabling easy calculation of mean and standard deviation for scaling operations.

Note: Uses standard_deviation instead of std to avoid conflicts with ndarray’s built-in methods.

Required Methods§

Source

fn mean(&self) -> Option<f64>

Calculate the mean of the array

Source

fn standard_deviation(&self, ddof: f64) -> f64

Calculate the standard deviation with specified degrees of freedom

Implementations on Foreign Types§

Source§

impl StatsExt for ArrayView1<'_, f64>

Source§

fn mean(&self) -> Option<f64>

Calculate the mean of the array

§Returns

Some(mean) if the array is not empty, None otherwise

Source§

fn standard_deviation(&self, ddof: f64) -> f64

Calculate the standard deviation

§Arguments
  • ddof - Degrees of freedom (delta degrees of freedom)
§Returns

Standard deviation of the array

Implementors§