Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley (view profile)


generates random variates from over 870 univariate distributions

neghyper2_pdf(n, v, w, nn)
% neghyper2_pdf.m - evaluates a Negative Hypergeometric Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp & Kotz,
%   J. Wiley, 2005, 254. 
%  Created by Jim Huntley,  7/23/07

function [pdf] = neghyper2_pdf(n, v, w, nn)

%persistent dterm

    dterm = binomial_coef(v+w-1+nn,nn);

pdf = binomial_coef(v+n,n) * binomial_coef(w+nn-n,nn-n) / dterm;


Contact us