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

absorp_pdf(n, q, mm, nn)
% Absorp_pdf.m - evaluates an Ansorption (Dunkl q-binomial) Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
%   J. Wiley, p.465, 2005. 
%
%  Created by Jim Huntley,  11/14/06
%

function [pdf] = absorp_pdf(n, q, mm, nn)

pdf = q^(mm*nn);
nmax = min(mm,nn);
if(n > 0)
    nprod = 1;
    dprod = 1;
    for jn = 1:n
        nprod = nprod * (1 - q^(mm+1-jn)) * (1 - q^(nn+1-jn));
    end
    for jn = 1:n
        dprod = dprod * (1 - q^jn);
    end
    pdf = q^((mm-n)*(nn-n)) * nprod / dprod;
end

return


Contact us