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

sobolevqr_cdf(x, p, q, r)
% sobolevqr_cdf.m - evaluates a Sobolev q-r Cumulative Distribution.
%   See "Continuous Univariate Distributions", vol. 2, Johnson, Kotz, &
%   Balakrishnan, J. Wiley, 1996, p.650.
%
%   Vector form of CDF!
%
%   Created by Jim Huntley,  12/02/09
%

function [cdf] = sobolevqr_cdf(x, p, q, 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(@sobolevqr_pdf,minx,x(jz),tol,trace,p,q,r);
end

return

Contact us