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

gamprod_cdf(x,a1,a2)
% gamprod_cdf.m - compute Gamma Product Cumulative Distribution Function.
%   See "Continuous Univariate Distributions", Johnson, Kotz & Balakrishnan,
%   Vol. 2, J. Wiley, 1995, p.353.               
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  10/20/08.
%

function [cdf] = gamprod_cdf(x,a1,a2)

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

minx = min(x);

% Integrate PDF to get CDF.
warning off MATLAB:quad:MinStepSize
for jz = 1:size(x,2);
    cdf(jz) = quad(@gamprod_pdf,minx,x(jz),tol,trace,a1,a2);
end

return



Contact us