File Exchange

image thumbnail

Truncated Normal Generator

version 1.0.0.0 (3.47 KB) by Zdravko Botev
truncated normal generator

28 Downloads

Updated 21 Apr 2016

View License

Very fast generator of vectors from the standard multivariate normal or Gaussian distribution, truncated over the region [l,u]. The generator is designed for both speed and accuracy --- especially in the tail of the normal distribution, where the inverse transform method frequently breaks down due to underflow errors.
Reference: Botev, Z. I. (2016). "The normal law under linear restrictions: simulation and estimation via minimax tilting". Journal of the Royal Statistical Society: Series B (Statistical Methodology). doi:10.1111/rssb.12162

For more information, see: https://en.wikipedia.org/wiki/Truncated_normal_distribution

Comments and Ratings (9)

Thank you for writing this simulator. Really helps!

Seongjin Jin

Stone Mathers

Andrew Benson

Thank you! This was way more efficient than my own code!

qiang zhang

Updates

1.0.0.0

- added some space to reference and a few more keywords

1.0.0.0

- updated reference; algorithm remains unchanged

1.0.0.0

Added a title and picture to the submission.

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

Discover Live Editor

Create scripts with code, output, and formatted text in a single executable document.


Learn About Live Editor