create_sampler

romanisim.cr.create_sampler(pdf, x)

A function for performing inverse transform sampling.

Parameters:
pdfcallable

A function or empirical set of tabulated values which can be used to call or evaluate x.

x1-d array of floats

A grid of values where the pdf should be evaluated.

Returns:
inverse_cdfcallable

Callable that gives the cumulative distribution function which allows sampling from the pdf distribution within the bounds described by the grid x.