cratermaker.utils.montecarlo_utils.bounded_norm#
- cratermaker.utils.montecarlo_utils.bounded_norm(mean, scale, size=1, rng=None, rng_seed=None, rng_state=None, **kwargs)[source]#
Sample from a truncated normal distribution that is bounded by 1-sigma stdev.
- Parameters:
loc (FloatLike) – mean of the distribution
scale (FloatLike) – standard deviation and bounds of the distribution
size (int or tuple of ints, optional) – The number of samples to generate. If the shape is (m, n, k), then m * n * k samples are drawn. If size is None (the default), a single value is returned if diameters is a scalar, otherwise an array of samples is returned with the same size as diameters.
rng (numpy.random.Generator | None) – A numpy random number generator. If None, a new generator is created using the rng_seed if it is provided.
rng_seed (Any type allowed by the rng_seed argument of numpy.random.Generator, optional) – The rng_seed for the RNG. If None, a new RNG is created.
rng_state (dict, optional) – The state of the random number generator. If None, a new state is created.
**kwargs (Any)
- Returns:
float – Truncated norm bounded by loc-scale, loc+scale