Draw samples from a probability distribution.

.sample_from_distribution(distribution, n)

Arguments

distribution

list. probability distribution specified in list format e.g. list(name = "gamma", shape = 2, scale = 4). The distribution list must contain a 'name' element, this element must be a string and correspond to one of the types of distributions supported in the Distributions package. distribution must also contain parameters for the specified distribution, in the form 'parameter_name=parameter_value'.

n

integer. Number of samples to draw.

Value

vector containing n samples of distribution