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

gumbel_cdf(x,r)
% gumbel_cdf.m - compute Gumbel Cumulative Distribution Function.
%   See "Continuous Univariate Distributions", Vol. 2, Johnson, Kemp, & Kotz, 
%   J. Wiley, p. 86, 1995.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  3/09/07
%

function [cdf] = gumbel_cdf(x,r)

tol = 1e-8;
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(@gumbel_pdf,minx,x(jz),tol,trace,r);
end

% Normalization.
cdf = cdf ./ max(cdf);

return



Contact us