image thumbnail

Truncated multivariate normal

version (7.2 KB) by Tim Benham
Generates pseudo-random vectors drawn from the truncated multivariate normal distribution.


Updated 26 Aug 2015

View License

X = rmvnrnd(MU,SIG,N,A,B) returns in N-by-P matrix X a
random sample drawn from the P-dimensional multivariate normal
distribution with mean MU and covariance SIG truncated to a
region bounded by the hyperplanes defined by the inequalities Ax<=B.
[X,RHO,NAR,NGIBBS] = rmvnrnd(MU,SIG,N,A,B) returns the
acceptance rate RHO of the accept-reject portion of the algorithm
(see below), the number NAR of returned samples generated by
the accept-reject algorithm, and the number NGIBBS returned by
the Gibbs sampler portion of the algorithm.
rmvnrnd(MU,SIG,N,A,B,RHOTHR) sets the minimum acceptable
acceptance rate for the accept-reject portion of the algorithm
to RHOTHR. The default is the empirically identified value

Cite As

Tim Benham (2021). Truncated multivariate normal (, MATLAB Central File Exchange. Retrieved .

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

Inspired by: Truncated Gaussian, chebycenter(A,b,r0)

Community Treasure Hunt

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

Start Hunting!