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

confluhyp_pdf(x, p, q, s)
% confluhyp_pdf.m - evaluates the Confluent Hypergeometric Probability Density Function.  
%                  See "A Generalization of Generalized Beta Distributions", M. B. Gordy, Fed. Res., 4/8/98.
%                  Vector Form!
%
% Created by Jim Huntley,  03/10/05
%

function [pdf] = confluhyp_pdf(x, p, q, s)

%persistent coef

%if(isempty(coef))
    B = beta(p,q);
    F11 = genHyper(p, p+q, -s); 
    coef = 1 / (B *F11);
%end

for jx = 1:size(x,2)
    pdf(jx) = 0;
    if(x(jx) > 0)               
        pdf(jx) = coef .* (x(jx))^(p-1) * (1-x(jx))^(q-1) * exp(-s*x(jx));
    end
end

return

Contact us