File Exchange

image thumbnail

Truncated Normal and Student's t-distribution toolbox

version 2.0 (839 KB) by Zdravko Botev
Perfect simulation from the truncated (multivariate) normal and student's t-distribution.


Updated 04 Feb 2016

View Version History

View License

The toolbox includes:
1. fast random number generators from the truncated univariate and multivariate student/normal distributions;
2. (Quasi-) Monte Carlo estimator of the cumulative distribution function of the multivariate student/normal;
3. accurate computation of the quantile function of the normal distribution in the extremes of its tails.
Z. I. Botev (2017), The Normal Law Under Linear Restrictions: Simulation and Estimation via Minimax Tilting, Journal of the Royal Statistical Society, Series B, Volume 79, Part 1, pp. 1-24

Cite As

Zdravko Botev (2021). Truncated Normal and Student's t-distribution toolbox (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (5)

Sterling Baird

Michal Mirowski


Thanks for your sampling method and it really helped me a lot, but when I tried the scalar case, error always occurred saying that
Inner matrix dimensions must agree.
Error in cholperm (line 20)

Could you please take a look at it?

Wilson González

What can I do to sample from a truncated multivariate Gaussian with non-zero mean when the number of inequality constraints is greater than the dimensionality of the random vector (matrix A is not squared)?

Thanks for sharing. Best regards

Anton Semechko

Thanks for making this toolbox available!

MATLAB Release Compatibility
Created with R2015b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: Truncated Normal Generator

Inspired: Truncated Normal Generator

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!