ProbabilityDistributions.jl
Provides log probability density functions, along with partial derivatives.
Install / Use
/learn @chriselrod/ProbabilityDistributions.jlREADME
ProbabilityDistributions
API is:
Distributions are structs, with unnormalized logdensity and ∂logdensity! methods.
logdensity(Noram{(true,false,true)}(), y, μ, σ)
∂logdensity!((∂y, ∂μ, ∂σ) Noram{(true,false,true)}(), y, μ, σ)
logdensity returns the target density in an unreduced form.
∂logdensity! returns a tuple (target,(∂y, ∂μ, ∂σ))
The true/false specifies whether the corresponding parameter is to be treated as a constant or as an unknown for the purpose of normalization.
∂logdensity! will calculate gradients for each unknown. If the corresponding entry, e.g. ∂y is nothing, it will return the calculated gradient.
Otherwise, it will return Zero().
