﻿# Cumulative integration initial values change array alignment, not the physical baseline

Cumulative integration initial values change array alignment, not the physical baseline. A focused scientific-computing guide with the documented mechanism, a reproducible validation scenario, evidence and operationa.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/science-cumulative-trapezoid-output-origin/
Language: en

The initial option of SciPy cumulative_trapezoid affects whether a leading value is included in the returned cumulative array. It is not a general field for adding a physical baseline to the entire integral. A scientific-data loader that confuses those roles can shift labels against coordinates or change only one entry while believing it has initialized a complete state trajectory.

## The scientific interface

The documented interface accepts zero or None for initial. With None, the result has one fewer element along the integration axis; inserting zero makes its length match the input. That leading zero represents accumulated integral at the first coordinate under this convention. A nonzero physical baseline requires a separately defined transformation of the cumulative result, not an unsupported arbitrary initial argument. Coordinate alignment must reflect which intervals have contributed to each returned value.

## Implementation details

Store the selected initial convention and integration axis with the derived feature. Pair the shorter result with the appropriate coordinate positions, or use the supported zero insertion when a full-length representation is intended. Apply an independently justified baseline uniformly under the physical model's rule and keep its units explicit. Validate the installed SciPy version rather than relying on behavior remembered from an older interface. Do not repair an alignment mismatch by dropping an arbitrary first or last coordinate until shapes happen to agree; the interval ownership must be the reason for the choice.

## A constructed validation case

Use a constant or otherwise analytically integrable signal on a known coordinate grid. Compare None and supported zero-initial outputs, checking each value's coordinate association. Add a separately applied nonzero physical baseline and an unsupported-initial request as different cases. Include a deliberately shifted pairing that keeps plausible values but attaches them to the wrong coordinates. Acceptance requires the declared alignment and baseline semantics, not shape equality alone or a test that merely checks the final cumulative value while ignoring the earlier samples.

## Numerical and data limits

This check establishes cumulative-array meaning, not physical conservation or model accuracy. Measurement noise, sampling and numerical integration error need separate assessment. Keep baseline and alignment provenance visible when cumulative features become targets for sequence models or scientific surrogate evaluation.

## Primary references

[SciPy integrate.cumulative_trapezoid API](https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.cumulative_trapezoid.html); [SciPy integration guide](https://docs.scipy.org/doc/scipy/tutorial/integrate.html).

This is a proposed scientific-interface validation, not an executed Retrivium benchmark. Preserve the implementation version and unresolved outcomes; interface documentation does not establish the accuracy or performance of a scientific model.

## Related reading

[Tensor axes in a language model: batch, sequence and hidden width](/journal/tensor-axes-batch-sequence-hidden/); [A GPU inference benchmark you can trust](/journal/inference-benchmark-method/).
