Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Sep 26, 2021
1 parent e995042 commit e683d48
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/stats/outliers.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@ import { getQuantiles } from './quantile.js'
// We compute it based on the actual measures distribution instead of using a
// fixed, hardcoded value which might trim too much or not enough for a given
// array of measures.
// The logic satisfies the following constaints:
// - It should work with a very big left|right tail
// - For example, widening the first|last quantile should not change the
// result
// - It should work with both fat and slim tails
// - Small bumps (aggregate of values) in the tail should be ignored providing
// they are either small and/or far in the tail.
// - This includes small bumps due to the sample size being low.
// - For distributions with multiple modes of similar enough size, each mode
// should be kept, even if far from each other
// - It should work with the following distributions:
// - Exponential with a high, continuous slope
// - Uniform
// - U-shaped
// - OutliersMin|Max 0 should be possible
// - It should work with integer measures
// - It should work with consecutive identical measures
// - It should work with very low sample size, including 1
export const getOutliersPercentages = function (measures) {
if (measures.length <= 2) {
return { outliersMin: 0, outliersMax: 0 }
Expand Down

0 comments on commit e683d48

Please sign in to comment.