Skip to content

Main content

Histogram Matched Bin Difference Table

Explicit finite ordered histogram edges and nonnegative mass observations; compare aligned right-minus-left bin masses with signed discrepancies and identical explicitly shared boundaries.

Loading tool…

Description

Compare aligned histogram masses using signed right-minus-left differences per bin and in 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.

Compare aligned histogram masses using signed right-minus-left differences per bin and in total.

When to use this tool

Use signed bin differences to compare two already aligned histograms on an explicit shared edge plan.

How to use the tool and how it works

  1. Enter edges, left, right using the definitions below.
  2. Run the operation. Resolve input-format errors before interpreting an output.
  3. Read result.difference, result.totalDifference, using the stated boundary, ordering, sign and absence conventions.

Validate left and right nonnegative mass arrays against one shared edge list. Subtract left from right bin by bin and sum the differences.1

Input fieldMeaning and unitsAccepted input
edgesAt least two finite strictly increasing coordinate edges. Their units define interval lengths and density units.Dense list of at most 128 finite numbers, under the stated integer/range rules.
leftLeft nonnegative bin masses, exactly aligned to the shared edges.Dense list of at most 128 finite numbers, under the stated integer/range rules.
rightRight nonnegative bin masses, exactly aligned to the shared edges.Dense list of at most 128 finite numbers, under the stated integer/range rules.
Output fieldInterpretation
resultObject containing the fields below.
result.differenceSigned right-minus-left mass for each aligned bin.
result.totalDifferenceSum of signed bin differences.
json
{
  "input": {
    "edges": [
      0,
      1,
      2
    ],
    "left": [
      1,
      4
    ],
    "right": [
      3,
      1
    ]
  },
  "output": {
    "result": {
      "difference": [
        2,
        -3
      ],
      "totalDifference": -1
    }
  }
}

Limitations and assumptions

  • The signed convention is right-minus-left. Equal edges establish alignment but do not establish comparable sample exposure, weights or normalization.
  • Edge lists contain at least two finite strictly increasing numbers. A mass array paired with edges has exactly one nonnegative finite mass per interval. Other mass-only operations accept empty arrays. Floating-point calculations do not imply exact decimal arithmetic or recover observations inside a bin.
  • 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 Matched Bin Difference Table — tool.io

Similar or alternative tools