scippuncertainty.mc.sampler.NormalDenseSampler#

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

Resample dense data from a Normal distribution.

Generates data arrays with the same metadata as the input and values drawn from a normal distribution with mean = input.values and standard_deviation = sqrt(input.variances).

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

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

Initialize a NormalDenseSampler.

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

  • copy (bool, default: True) – If True, NormalDenseSampler.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 NormalDenseSampler.

clone()

Return a new NormalDenseSampler.

sample_once(rng)

Return a new sample.

clone()[source]#

Return a new NormalDenseSampler.

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

Return type:

NormalDenseSampler

sample_once(rng)[source]#

Return a new sample.

Return type:

DataArray