sample_distribution_func#
- atompy.sample_distribution_func(f, size, xlimits, ylimits, rng, *args, **kwargs)[source]#
Sample a distribution described by
f.- Parameters:
- fCallable
Function which shape the distribution should follow. Call signature is
f(x, *args, **kwargs).- size
int Size of the distribution.
- xlimits
tuple[int,int] Lower and upper limits in-between which to sample the distribution.
- ylimits
tuple[int,int] or"auto" Maximum and minimum value of
f(x). Return should be larger zero in-betweenxlimits.If
"auto", calculate 100 steps off(x), wherexlimits[0] <= x < xlimits[1]and setylimtis = (0.0, max(f(x))).
- Returns:
- sample
ndarray, shape(size,) A sample ranging from
xlimits[0]toxlimits[1]with a distribution corresponding tof.
- sample
- Other Parameters:
- *args
Additional positional arguements of
f.- **kwargs
Additional keyword arguments of
f.
Notes
See also Sample a random distribution.