Skip to content

histogram(values, options): Histogram

Defined in: packages/distribution/src/sample-statistics.ts:210

Histogram with NumPy’s np.histogram semantics: bin i is [edges[i], edges[i + 1]) and the last bin is closed on both ends. { bins } spans the sample’s range with equal-width bins, widened by 0.5 on each side when the sample is constant. { edges } uses the supplied edges, and values outside them are not counted. The input is not mutated.

NumericSample

HistogramOptions

Histogram

INVALID_SAMPLE when values is empty or holds a non-finite value; INVALID_PARAMETER when bins is not a positive integer or edges are not at least 2 finite, strictly increasing numbers.