Type hierarchy in Distributions.jl
The functions provided in Distributions.jl
follow a hierarchy. Let's go through it to understand the capabilities of the package.
Understanding Sampleable
Sampleable is an abstract type that includes samplers and distributions from which one can draw samples. It is defined as follows:
The kinds of samples that can be drawn are defined by the two parameter types:
VariateForm:
Univariate: Scalar number
Multivariate: Numeric vector
Matrixvariate: Numeric matrix
ValueSupport:
Discrete: Int
Continuous: Float64
We can extract the information about the sample that the Sampleable object generates. An array can contain multiple samples depending on the variate form. We can use various functions to get the information (let's assume sampobj
is the sampleable object):
length(sampobj)
: As the name suggests, it gives the length of the sample, which is 1 when the object is Univariatesize(sampobj)
: This returns the shape of the samplensamples(sampobj, X)
: This returns the...