Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

James Huntley (view profile)

 

generates random variates from over 870 univariate distributions

irwinhall_cdf(x,a,k)
%irwinhall_cdf.m - evaluates an Irwin Hall Cumulative Distribution.
%   "Continuous Univariate Distributions", v.2, Johnson, Kotz, and Balakrishnan,
%   Wiley, 1996, p. 296.

function[cdf] = irwinhall_cdf(x,a,k)

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(@irwinhall_pdf,minx,x(jz),tol,trace,a,k);
end

return
    
    
    
    



Contact us