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 withmean = input.values
andstandard_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
) – IfTrue
,NormalDenseSampler.sample_once()
returns a new array. IfFalse
, it returns a reference to the same array every time but updates the values in-place. Use with caution!copy_in (
bool
, default:True
) – IfTrue
,data
is copied during initialization. IfFalse
, 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.