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

bessel2_cdf(x,bet,lambda,theta);
% bessel2_cdf.m - compute Bessel2 Cumulative Distribution Function.
%               See "Non-Uniform Random Variates", L. Devroye, Springer-Verlag, 1986, p.469.                
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  08/20/04.
%

function [cdf] = bessel2_cdf(x,bet,lambda,theta);

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(@bessel2_pdf,minx,x(jz),tol,trace,bet,lambda,theta);
end

return



Contact us