scippuncertainty.mc.sampler.PoissonDenseSampler#

class scippuncertainty.mc.sampler.PoissonDenseSampler(data, copy=True, copy_in=True)[source]#

Resample dense data from a Poisson distribution.

Generates data arrays with the same metadata as the input and values drawn from a Poisson distribution with mean = input.values.

The input data must be dense, i.e. not binned.

__init__(data, copy=True, copy_in=True)[source]#

Initialize a PoissonDenseSampler.

Parameters:
  • data (DataArray) – Input data to sample from.

  • copy (bool, default: True) – If True, PoissonDenseSampler.sample_once() returns a new array. If False, it returns a reference to the same array every time but updates the values in-place. Use with caution!

  • copy_in (bool, default: True) – If True, data is copied during initialization. If False, the sampler keeps a reference to the input object.

Methods

__init__(data[, copy, copy_in])

Initialize a PoissonDenseSampler.

clone()

Return a new PoissonDenseSampler.

sample_once(rng)

Return a new sample.

clone()[source]#

Return a new PoissonDenseSampler.

The returned sampler is independent of self and samples from the same data.

Return type:

PoissonDenseSampler

sample_once(rng)[source]#

Return a new sample.

Return type:

DataArray