Module theil_sen

Source
Available on crate feature regression only.
Expand description

Theil-Sen estimator, a robust linear (also implemented as polynomial) estimator. Up to ~27% of values can be outliers - erroneous data far from the otherwise good data - without large effects on the result.

LinearTheilSen implements LinearEstimator.

Structs§

LinearTheilSen
Linear estimation using the Theil-Sen estimatior. This is robust against outliers. O(n²)
PermutationIter
An iterator over the permutations.
PermutationIterBuffer
A buffer returned by PermutationIter to avoid allocations.
PolynomialTheilSen
Polynomial estimation using the Theil-Sen estimatior. Very slow and should probably not be used. O(n^degree)

Functions§

estimate_permutation_count
Lower-bound estimate (up to pairs > 20), within 100x (which is quite good for factorials).
permutation_count
An exact count of permutations. Returns None if the arithmetic can’t fit.
permutations
Unique permutations of two elements - an iterator of all the pairs of associated values in the slices.
permutations_generic
The returned iterator is a bit funky. It returns a buffer, which at all costs should be reused. This could either be done using a while loop (e.g. while let Some(buf) = iter.next() { iter.give_buffer(buf) }) or any of the built-in methods. If you know the length at compile time, use PermutationIter::collect_len.
slow_linear
Naive Theil-Sen implementation, which checks each line.
slow_polynomial
Naive Theil-Sen implementation, which checks each polynomial.