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

wtdelnegbin_pdf(n, p, m, nn)
% wtdelnegbin_pdf.m - evaluates a Weighted Delta Negative Binomial Probability Density.
%   See "Lagrangian Probability Distributions", P.C. Consul & F. Famoye,
%   Birkhauser, 2006, Table 2.4.
%
%   Doesn't normalize for p >~ 0.5 !!!
%
%  Created by Jim Huntley,  11/25/08
%

function [pdf] = wtdelnegbin_pdf(n, p, m, nn)

q = 1 - p;

pdf = binomial_coef((m+1)*n-nn-1,n-nn) * (1-m*p/q) * p^(n-nn) * q^(m*n);

return

Contact us