ObservableAccumulator
gammaloop Class
ObservableAccumulator()Independent observable statistics compiled from one integrand's definitions.
Construct with api.observable_accumulator() and add exactly one evaluation record per independent draw. The coefficient is the complete outer weight; zero keeps the attempted sample count without fills. Event groups stay unmodified.
Examples
accumulator = api.observable_accumulator()
batch = api.evaluate_samples(points)
for sample in batch.samples:
accumulator.add_sample(sample, sample.integrator_weight)
histograms = accumulator.snapshot()Member details
add_sample
Method#add_sample(sample: EvaluationResult, coefficient: float) -> None Commit one sample with an explicit outer weight, including zero-weight misses.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
sample | EvaluationResult | — | — |
coefficient | float | — | — |
merge_in_place
Method#merge_in_place(other: ObservableAccumulator) -> NoneMerge independent sample statistics without changing the source accumulator.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
other | ObservableAccumulator | — | — |
sum_independent_estimates
Static method#sum_independent_estimates(accumulators: Sequence[ObservableAccumulator]) -> Any Sum means and variances of independent populations, preserving their separate counts. Merge batches within a stratum before passing its accumulator here.
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
accumulators | Sequence[ | — | — |
snapshot
Method#snapshot() -> dictReturn mergeable raw histogram statistics, without clearing or committing them.
View generated signature source: docs/api/python/gammaloop-python.pyi:1866