TruncatedDistributions.jl Documentation
A Julia package for Truncated Distributions including multi-variate truncated distributions.
For example:
julia> using TruncatedDistributions, PDMats
julia> d = BasicBoxTruncatedMvNormal([2.3,4.3],PDMat([1.0 0.3; 0.3 2.4]),[-1.0, 0.5],[5.2,1.8]);
julia> mean(d)
2-element Vector{Float64}:
1.930922186217924
1.3227326677503652
julia> d.state.μ_err
3.457541323608117e-8Specific Types
TruncatedDistributions.BasicBoxTruncatedMvNormal — TypeA Box Truncated normal distribution with a naive implementation and representation in the state of the mean and covariance. Works well for very low dimensions (e.g. 2,3,4).
TruncatedDistributions.RecursiveMomentsBoxTruncatedMvNormal — TypeA Box Truncated normal distribution with a recursive moment computation implementation.
Common Types
The key type exposed by this package is TruncatedMvDistribution. It is parameterized by a MultivariateDistribution from Distributions.jl, a TruncationRegion, and an additional type called the TruncatedMvDistributionState.
TruncatedDistributions.TruncatedMvDistribution — TypeA truncated multi-variate distribution composed of a Multivariate Distribution, Truncation Region and a State object implementing computable state.
TruncatedDistributions.TruncationRegion — TypeA truncation region defines a subset of space to which the distribution is truncated. The basic operation supported is intruncationregion(), which returns true if a vector is inside the truncation region.
TruncatedDistributions.TruncatedMvDistributionState — TypeA state abstract object representing computed quantities of a truncated multivariate distribution.
Every concrete subtype should expose at least the following two fields.
n::IntThe length of the distributiontp::Float64The probability of falling in the truncation region for the non-truncated case.tp_err::Float64An estimate of the absolute error of the probabilitytp.
Other subtypes may expose.
μ::Vector{Float64}The mean vector.μ_err::Float64An estimate of the relative error for the mean vector.Σ::PDMatThe covariance matrix.Σ_err::Float64An estimate of the relative error for the covariance matrix.
Further subtypes may expose.
moment_dict::Dict{Vector{Int},Float64}A dictionary mapping multivariate moment vectors to estimate quantities.prob_dictA dictionary mapping probability vectors to estimated quantities.
Functions
Missing docstring for TruncatedMvDistribution{D <: MultivariateDistribution, R <: TruncationRegion}. Check Documenter's build log for details.