Dispatching is one of Julia’s strong suits. I was wondering, is there a single function which would generate a
random element based on a given probability distribution function, a random number genarator and a given element interval? I’m using Julia 0.7. If not, what are your suggestions?
I’m talking about something similar to the fit_mle(D, x, w) method in the DIstribution.jl.
Distributions.fit_mle— Method.fit_mle(D, x, w)Fit a distribution of type
Dto a weighted data setx, with weights given byw.Here,
wshould be an array with lengthn, wherenis the number of samples contained inx.Applicable distributions
The
fit_mlemethod has been implemented for the following distributions:Univariate:
Bernoulli
Beta
Binomial
Categorical
DiscreteUniform
Exponential
Normal
Gamma
Geometric
Laplace
Pareto
Poisson
UniformMultivariate: