InverseCDFSampler#
- class gammapy.utils.random.InverseCDFSampler[source]#
Bases:
object
Inverse CDF sampler.
It determines a set of random numbers and calculate the cumulative distribution function.
- Parameters:
- pdf
Map
Map of the predicted source counts.
- axisint
Axis along which sampling the indexes.
- random_state{int, ‘random-seed’, ‘global-rng’,
RandomState
} Defines random number generator initialisation. Passed to
get_random_state
.
- pdf
Methods Summary
sample
(size)Draw sample from the given PDF.
Sample along a given axis.
Methods Documentation
- sample(size)[source]#
Draw sample from the given PDF.
- Parameters:
- sizeint
Number of samples to draw.
- Returns:
- indextuple of
ndarray
Coordinates of the drawn sample.
- indextuple of
- sample_axis()[source]#
Sample along a given axis.
- Returns:
- indextuple of
ndarray
Coordinates of the drawn sample.
- indextuple of
- classmethod __new__(*args, **kwargs)#