|
Last change
on this file since e4c61dd was e4c61dd, checked in by istevanoska <ilinastevanoska@…>, 6 months ago |
|
Prototype 1.1
|
-
Property mode
set to
100644
|
|
File size:
303 bytes
|
| Line | |
|---|
| 1 | import count from "../count.js";
|
|---|
| 2 | import quantile from "../quantile.js";
|
|---|
| 3 |
|
|---|
| 4 | export default function thresholdFreedmanDiaconis(values, min, max) {
|
|---|
| 5 | const c = count(values), d = quantile(values, 0.75) - quantile(values, 0.25);
|
|---|
| 6 | return c && d ? Math.ceil((max - min) / (2 * d * Math.pow(c, -1 / 3))) : 1;
|
|---|
| 7 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.