Function smartnoise_runtime::components::variance::variance[][src]

pub fn variance(
    data: &ArrayD<Float>,
    delta_degrees_of_freedom: usize
) -> Result<ArrayD<Float>>

Calculate estimate of variance for each column in data.

Arguments

Return

Variance for each column in the data.

Example

use ndarray::prelude::*;
use smartnoise_runtime::components::variance::variance;
let data = arr2(&[ [1.,10.], [2., 20.], [3., 30.] ]).into_dyn();
let variances = variance(&data, 1).unwrap();
assert_eq!(variances, arr2(&[[1., 100.]]).into_dyn());