Function (class)
A function distribution consisting of some callable function along with args/kwargs which can each be other Distribution objects.
For example:
def func(a, b, c=1, d=5):
return a*b + c*d
a = distl.gaussian(10, 2)
b = distl.uniform(3, 5)
d = 6
f = distl.function(func, args=(a, b), kwargs={'d': d}, vectorized=True)
print(f)
Note: using Function.to_file or from_file requires the dill
package
to be installed.
Treatment "under-the-hood":
-
sampling is handled by sampling the underyling children and therefore can retain covariances. The pdfs, cdfs, and ppfs are created by taking Function.hist_samples samples, converting to a Histogram with 100 bins, and using the underlying scipy.stats.rv_histogram, thereby losing all covariances.
- arccos
- arcsin
- arctan
- arctan2
- args
- args_as_dists
- cached_sample
- cached_sample_children
- cdf
- clear_cached_sample
- copy
- cos
- dc
- deepcopy
- dist_constructor_args
- dist_constructor_func
- dist_constructor_object
- dists
- entropy
- expect
- func
- get_wrap_at
- hist_samples
- interval
- isf
- kwargs
- kwargs_as_dists
- label
- label_latex
- log
- log10
- logcdf
- logpdf
- logsf
- mean
- median
- moment
- plot
- plot_cdf
- plot_gaussian
- plot_pdf
- plot_sample
- plot_uncertainties
- ppf
- sample
- sample_args_kwargs
- sf
- sin
- std
- tan
- to
- to_delta
- to_dict
- to_file
- to_gaussian
- to_histogram
- to_json
- to_samples
- to_si
- to_solar
- to_uniform
- uncertainties
- uniqueid
- unit
- var
- vectorized
- wrap
- wrap_at