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

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

function [cdf] = polya_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(@polya_pdf,minx,x(jz),tol,trace,bet,lambda,theta);
end

return



Contact us