﻿# Simpson integration exactness depends on the actual sample grid

Simpson integration exactness depends on the actual sample grid. A focused scientific-computing guide with the documented mechanism, a reproducible validation scenario, evidence and operational limits.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/science-simpson-irregular-grid-exactness/
Language: en

A Simpson integration label can be exact for one sampling grid and approximate for another, even when the sampled function has the same polynomial degree. A scientific AI dataset should preserve the actual coordinates instead of attaching a universal accuracy claim to the method name. Grid regularity and sample-count conditions are part of the numerical reference contract.

## The scientific interface

SciPy's simpson notes give polynomial exactness conditions tied to an odd number of equally spaced samples, and a lower degree guarantee for unequally spaced samples. Those conditions do not cover every arbitrary grid and sample count. Providing x supplies actual spacing; omitting it uses the declared regular-spacing convention. If irregular observations are passed as though they were uniformly spaced, the calculation can represent a different coordinate measure rather than merely a less accurate version of the intended integral.

## Implementation details

Store the coordinate array, integration axis and the exact sampling conditions with generated labels. Distinguish a documented exactness condition from an observed small error on a particular function. When observations are irregular, pass and validate their coordinates under the intended path rather than substituting average spacing without review. Keep any resampling into a regular grid as another transformation with its own interpolation error. Compare numerical reference uncertainty against the model differences the experiment aims to detect, so a convenient integration method does not become an unexplained source of label noise.

## A constructed validation case

Use independently integrable polynomial fixtures on regular and deliberately irregular grids. Check the documented conditions and compare actual numerical error rather than expecting identical results from all samplings. Add an irregular-grid run that incorrectly omits x as a negative control. Acceptance requires truthful grid metadata and an error level justified for the selected reference use. It does not establish universal exactness from the word Simpson or prove that a learned model reproducing the numerical labels is equally accurate against the underlying continuous function.

## Numerical and data limits

A quadrature fixture validates a numerical preparation step, not sensor calibration or model generalization. Keep sampling error, interpolation error and learned approximation error distinguishable. That makes scientific AI comparisons more informative than a single score against undocumented discretized labels.

## Primary references

[SciPy integrate.simpson API](https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.simpson.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

[Apache Arrow: nulls, empty lists and nested training features](/journal/data-guide-arrow-nullable-feature-contract/); [A GPU inference benchmark you can trust](/journal/inference-benchmark-method/).
