Rank: 270422 based on 0 downloads (last 30 days) and 0 file submitted
photo

Ze Dagher

E-mail
Company/University
University of Colorado, School of medicine

Personal Profile:
Professional Interests:

 

Watch this Author's files

 

Comments and Ratings by Ze View all
Updated File Comments Rating
12 Aug 2010 Truncated Gaussian Generate a pseudo-random vector X drawn from the truncated Gaussian distribution Author: Bruno Luong

Thanks Bruno. This turned out to be the issue in the second problem I described. The output now matches derivations.

10 Aug 2010 Truncated Gaussian Generate a pseudo-random vector X drawn from the truncated Gaussian distribution Author: Bruno Luong

Bruno,

your code has one problem. Enter this command and see what happens:
Y = TruncatedGaussian(-1,[10 20],[1 1000]);
All the values returned are 20s. I know that 10 to 20 is a very unlikely range with a distribution of N(0,1) but still, I am just showing here that I noticed that your code returns wrong values sometimes.

Another (possibly related) problem is when you try and generate a distribution with non-zero mean with the range being a bit far from the mean. The histogram of the returned values does not match a trusted method I used. I am not sure what this is about.

Contact us