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

maxnegbin_pdf(n, c, p)
% maxnegbin_pdf.m - evaluates a Maximum Negative Binomial Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp, & Kotz,
%   J. Wiley, 2005, p. 245.
%
%  Created by Jim Huntley,  7/11/07
%

function [pdf] = maxnegbin_pdf(n, c, p)

q = 1 - p;
pdf = binomial_coef(2*c+n-1,c-1) * (p^n + q^n) * (p*q)^c;

return

Contact us