Skip to content

Main content

Histogram Sample Provenance Groups

Group source observation indexes by explicit histogram bin using final-edge-inclusive convention, preserving duplicates and outside provenance.

Loading tool…

Description

Group original observation indexes into explicit histogram bins and retain outside-domain indexes.

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.

Group original observation indexes into explicit histogram bins and retain outside-domain indexes.

When to use this tool

Use provenance groups to trace each binned or out-of-domain observation back to its original position.

How to use the tool and how it works

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

For each observation in original order, find its interval among the increasing edges and append the original observation index to that bin. Record indexes outside the full edge domain separately.1

Input fieldMeaning and unitsAccepted input
valuesFinite observations in original input order, on the edge coordinate scale.Dense list of at most 128 finite numbers, under the stated integer/range rules.
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.
Output fieldInterpretation
resultObject containing the fields below.
result.binsOne list per bin containing original observation indexes, in observation order.
result.outsideOriginal indexes of observations outside the inclusive outer edge domain.
json
{
  "input": {
    "values": [
      -1,
      0,
      1,
      2,
      3
    ],
    "edges": [
      0,
      1,
      2
    ]
  },
  "output": {
    "result": {
      "bins": [
        [
          1
        ],
        [
          2,
          3
        ]
      ],
      "outside": [
        0,
        4
      ]
    }
  }
}

Limitations and assumptions

  • Bins include their left edge and exclude their right edge, except that the final edge belongs to the last bin. Duplicate values retain separate original indexes.
  • 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 Sample Provenance Groups — tool.io

Similar or alternative tools