1.3.0 • Published 8 years ago

speed-percentile v1.3.0

Weekly downloads
18
License
ISC
Repository
github
Last release
8 years ago

speed-percentile

Build Status

A JavaScript utility to compute percentile speed from speed histogram.

Example:

var percentile = require('speed-percentile');

var histogram = {20: 1, 21: 1, 22: 2, 23: 3, 24: 4, 25: 5};

var speed = percentile(histogram, 0.85, 'R4');
//=> 24.52

Install

npm install speed-percentile

Test

cd to speed-percentile folder then run

npm test

Syntax

percentile

var o1 = percentile(P1, P2, P3)

Computes the p-th precentile speed from a sparse hash speed histogram.

Inputs:

paramdata typedescription
P1associative array with integer keysspeed histogram hash {<speed>:<count>}
P2number or arrayone or more percentiles in decimal
P3stringalgorithm flag (optional): 'R4', 'R5' (default)

Algorithms:

Outputs:

outputdata typedescription
o1number or arraycorresponding speed(s) sorted in descending order
1.3.0

8 years ago

1.2.1

8 years ago

1.2.0

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago