Skip to content

Add support for quantiles and standardDeviation #3

@rowanwins

Description

@rowanwins

I've been doing something similar in my geotiff-server. The other stats I found happy for colour balancing were quantiles at 2% and 98%, and the standard deviation

In my code it looked something like

import {min, max, quantile, standardDeviation} from 'simple-statistics'

function getBasicStats (arr) {
  var filtered = arr.filter(function (element) {
    return element !== -999
  })
  return {
    percentiles: [quantile(filtered, 0.02), quantile(filtered, 0.98)],
    min: min(filtered),
    max: max(filtered),
    stdDeviation: standardDeviation(filtered)
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions