distl.function (function)
def function(func, args=[], kwargs={}, vectorized=True, hist_samples=None, unit=None, label=None, label_latex=None, wrap_at=None)
Create a Function distribution.
Arguments
func: callable function that accepts args and kwargs (as floats, after being sampled from any distribution objects)args(list of distribution objects or floats): distribution objects or floats to pass as args tofunc. Any items that are Distribution objects will be sampled and passed as floats.kwargs(dictionary of distribution objects or floats): distribution objects or floats to pass as kwargs tofunc. Any items that are Distribution objects will be sampled and passed as floats.vectorized(bool, optional, default=True): whetherfuncsupports passing arrays toargsandkwargs.hist_samples(int, optional, default=None): number of samples to draw when generating the underlying Histogram distribution used for all probability calls. If not provided or None, this will default to 1e6 ifvectorizedor 1e5 if not. Iffunctakes a long time or many samples in Function.sample are rejected and have to be re-drawn, it may be necessary to lowerhist_samples.unit(astropy.units object, optional): the units returned byfunc. Note that any Distribution objects inargsandkwargsshould be in the appropriate units (as the inputs and outputs tofuncare floats and not quantities)label(string, optional): a label for the distribution. This is used for the x-label while plotting the distribution iflabel_latexis not provided, as well as a shorthand notation when creating a Composite distribution.label_latex(string, optional): a latex label for the distribution. This is used for the x-label while plotting.wrap_at(float, None, or False, optional, default=None): value to use for wrapping. If None andunitare angles, will default to 2*pi (or 360 degrees). If None andunitare cycles, will default to 1.0.
Returns
- a Function object