Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

 

generates random variates from over 870 univariate distributions

toranzo_cdf(x, a, b, c)
% toranzo_cdf.m - compute Toranzo Cumulative Distribution Function.
%   See "Non-Uniform Random Deviates", L. Devroye, McGill, p. 482. 
%   NOTE: Distribution is NOT Normalized !!!
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  07/19/05.
%

function [cdf] = toranzo_cdf(x, a, b, c)

tol = 1e-12;
trace = [];
warning off MATLAB:quad:MinStepSize;

minx = min(x);

% Integrate PDF to get CDF.
warning off MATLAB:quad:MinStepSize
sz = size(x,2);
for jz = 1:sz
    cdf(jz) = quad(@toranzo_pdf,minx,x(jz),tol,trace,a,b,c);
end

cdf = cdf ./ max(cdf);

return



Contact us