Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley


generates random variates from over 870 univariate distributions

trungaus_pdf(x, a, b, mu, sigma)
% trungaus_pdf.m - evaluates the Truncated Gaussian Probability Density.  
% See "Dataplot Reference Manual", TNRPDF, p. Aux-354, NIST, 26 March, 1977. 
% Created by:   Jim Huntley,  08/22/02.

function [pdf] = trungaus_pdf(x, a, b, mu, sigma)

phir = gaus_cdf(b, mu, sigma);
phil = gaus_cdf(a, mu, sigma);
pdf = gaus_pdf(x, mu, sigma) / (phir - phil);


Contact us