Struct criterion_stats::univariate::Sample[][src]

pub struct Sample<A>(_);

A collection of data points drawn from a population

Invariants:

  • The sample contains at least 2 data points
  • The sample contains no NaNs

Methods

impl<A> Sample<A>
[src]

Returns a slice that contains all the data points

NOTE: This will be removed in favor of a Deref<Target=[A]> implementation once rust-lang/rust#22257 is fixed.

impl<A> Sample<A> where
    A: Float, 
[src]

Creates a new sample from an existing slice

Panics

Panics if slice contains any NaN or if slice has less than two elements

Returns the biggest element in the sample

  • Time: O(length)

Returns the arithmetic average of the sample

  • Time: O(length)

Returns the median absolute deviation

The median can be optionally passed along to speed up (2X) the computation

  • Time: O(length)
  • Memory: O(length)

Returns the median absolute deviation as a percentage of the median

  • Time: O(length)
  • Memory: O(length)

Returns the smallest element in the sample

  • Time: O(length)

Returns a "view" into the percentiles of the sample

This "view" makes consecutive computations of percentiles much faster (O(1))

  • Time: O(N log N) where N = length
  • Memory: O(length)

Returns the standard deviation of the sample

The mean can be optionally passed along to speed up (2X) the computation

  • Time: O(length)

Returns the standard deviation as a percentage of the mean

  • Time: O(length)

Returns the sum of all the elements of the sample

  • Time: O(length)

Returns the t score between these two samples

  • Time: O(length)

Returns the variance of the sample

The mean can be optionally passed along to speed up (2X) the computation

  • Time: O(length)

Returns the bootstrap distributions of the parameters estimated by the 1-sample statistic

  • Multi-threaded
  • Time: O(nresamples)
  • Memory: O(nresamples)

Auto Trait Implementations

impl<A> Send for Sample<A> where
    A: Send

impl<A> Sync for Sample<A> where
    A: Sync