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

pearson1_cdf(x,a,b,c,d)
% pearson1_cdf.m - evaluates a Pearson I Cumulative Distribution.
%   See "Non-Uniform Random Deviates", L. Devroye, Chapter 9.
%
%  Created by Jim Huntley,  08/18/06
%

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

tol = 1e-8;
trace = [];
warning off MATLAB:quad:MinStepSize;
minx = min(x);

warning off MATLAB:quad:MinStepSize
sz = size(x,2);

for jx = 1:sz
    cdf(jx) = quad(@pearson1_pdf,minx,x(jx),tol,trace,a,b,c,d);
end

% Normalize CDF.
cdf = cdf ./ max(cdf);

return

Contact us