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

poisbeta2_pdf(n, m, nu)
% poisbeta2_pdf.m - evaluates a Poisson Beta2 Probability Density.
%   See "A Unified Approach to Some Mixed Poisson Distributions", 
%   M.E. Ghitany and S.A. Al-Awadhi, Tamsui Oxford J. of Math. Sciences, p.147, 2001.
%
%  Created by Jim Huntley,  04/16/09
%

function [pdf] = poisbeta2_pdf(n, m, nu)

%persistent lbmnu 

%if(isempty(lbmnu))
    lbmnu =log(beta(m,nu));
%end

for jn = 1:size(n,2)
    a = n(jn) + m;
    b = n(jn) + 1 - nu;
    z = 1;
    U = KummerU(a, b, z);
    pdf(jn) = exp(gammaln(n(jn)+m) + log(real(U)) - lbmnu - gammaln(n(jn)+1)); 
end

return

Contact us