I’m happy to announce a substantial update to TruncatedDistributions.jl, now at 0.3.0. The package has been around for a couple of years, but was fairly bare.
It now gives solid support for the truncated multivariate normal, has a few special tools for univariate truncation, and for the multivariate normal it can also fit the parameters for a desired mean and covariance (after truncation).
Key features at this point:
- Box-truncated multivariate normal as a proper distribution object (TruncatedMvNormal), truncated to a hyper-rectangle [a, b].
- Exact moments of the truncated MVN via Kan & Robotti recursions, with two backends (
:hcubatureand:mvnormalcdf) so you can trade speed against accuracy. - Parameter fitting (
fit_mvnormal): give it a target mean/covariance after truncation, and it solves for the underlying MVN parameters that produce them. - Univariate dynamic moment matching (
dynamic_fit_locationscale): an ODE/homotopy method (Liquet & Nazarathy, 2015) that finds a location-scale or exponential distribution whose truncation to [a, b] hits a target mean and variance.
See the GitHub Repo.
Cheers,
Yoni.