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

gengam5p_cdf(x,t1,t2,t3,t4)
% gengam5p_cdf.m - compute Generalized Gamma 5-Parameter Cumulative Distribution Function.
%   See "Continuous Univariate Distributions", Johnson, Kotz & Balakrishnan,
%   Vol. 2, J. Wiley, 1995, p.649.             
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  10/20/08.
%

function [cdf] = gengam5p_cdf(x,t1,t2,t3,t4)

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

minx = min(x);
pdf = gengam5p_pdf(x,t1,t2,t3,t4);
% Integrate PDF to get CDF.
warning off MATLAB:quad:MinStepSize
for jz = 1:size(x,2);
    cdf(jz) = quad(@gengam5p_pdf,minx,x(jz),tol,trace,t1,t2,t3,t4);
end

return



Contact us