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

gaushyp_cdf(x,p,q,r,lambda)
% gaushyp_cdf.m - compute Gauss Hypergeometric Cumulative Distribution Function.
%                  See "A Generalization of Generalized Beta Distributions", M. B. Gordy, Fed. Res., 4/8/98.
%
%                  Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  03/10/05.
%

function [cdf] = gaushyp_cdf(x,p,q,r,lambda)

% Integrate PDF to get CDF.
pdf = gaushyp_pdf(x,p,q,r,lambda);
for jz = 1:size(x,2)
    if(jz == 1)
        cdf(jz) = trapz(pdf(1:jz));
    elseif(jz == 2)
        dx = x(2) - x(1);
        cdf(jz) = trapz(pdf(1:jz)) * dx;
    elseif(jz > 2)
        cdf(jz) = simps(pdf(1:jz)) * dx;
    end
end

return



Contact us