Skip to content

Main content

Histogram Bin Probability Table

Normalize supplied nonnegative histogram counts/weights into per-bin observed mass, with null for a zero-total bank; no underlying distribution claim.

Loading tool…

Description

Convert supplied bin masses into fractions of total mass, returning nulls for zero total.

Histogram edges divide a numeric coordinate axis into ordered bins, while each bin mass represents a count or nonnegative weight. Probability mass is a fraction of the total; probability density additionally divides by bin width and therefore has inverse coordinate units. An edge plan alone contains no observations.

Convert supplied bin masses into fractions of total mass, returning nulls for zero total.

When to use this tool

Use mass fractions when the question concerns each bin’s share rather than density per coordinate unit.

How to use the tool and how it works

  1. Enter mass using the definitions below.
  2. Run the operation. Resolve input-format errors before interpreting an output.
  3. Read result.total, result.probabilities, using the stated boundary, ordering, sign and absence conventions.

Sum the nonnegative masses. For positive total, divide each mass by that total; for zero total, return null at every probability position.1

Input fieldMeaning and unitsAccepted input
massNonnegative finite bin masses in bin order; paired edge lists require mass.length=edges.length-1.Dense list of at most 128 finite numbers, under the stated integer/range rules.
Output fieldInterpretation
resultObject containing the fields below.
result.totalSum of supplied nonnegative bin mass.
result.probabilitiesMass/total per bin, or null in every position when total=0.
json
{
  "input": {
    "mass": [
      1,
      3,
      0
    ]
  },
  "output": {
    "result": {
      "total": 4,
      "probabilities": [
        0.25,
        0.75,
        0
      ]
    }
  }
}

Limitations and assumptions

  • These are fractions of the supplied mass. They are not density per coordinate width or an inference about population probabilities.
  • Masses are nonnegative finite counts or weights in bin order. Empty mass arrays are allowed. Floating-point arithmetic does not infer underlying observations or a population distribution.
  • Every declared outer field is required and unknown outer fields are rejected. Strings and JSON text have size limits, lists are bounded to 128 entries, and JSON nesting/node counts are bounded. Tighter operation-specific bounds stated above take precedence.
  • Numeric outputs must remain finite and within safe-integer magnitude. Original record indexes and cell coordinates are zero-based; stated half-open ranges exclude their end.

Alternative or Complementary methods

Keep edge definitions with mass arrays. Use common-boundary coarsening and whole-bin merging for aligned comparisons; use observation-level data when a calculation requires locations within bins.

References

  1. Tool behavior and example: Histogram Bin Probability Table — tool.io

Similar or alternative tools