Skip to main content

permutation_test

Function permutation_test 

Source
pub fn permutation_test(
    x: &[f64],
    y: &[f64],
    statistic: impl Fn(&[f64], &[f64]) -> f64,
    alternative: Alternative,
    n_resamples: usize,
    seed: u64,
) -> Result<PermutationResult, ErrorsJSL>
Expand description

A two-sample permutation test (SciPy’s permutation_test with permutation_type='independent'): the statistic f(x, y) is recomputed for every way of splitting the pooled observations into groups of the original sizes when there are at most n_resamples of them (exact), and otherwise for n_resamples random splits, for which the p-value counts the observed split as well.