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

modbinom1_pdf(n, nn, m, p)
% modbinom1_pdf.m - evaluates a First Modified Binomial Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
%   J. Wiley, p.492, 2005. 
%
%  Created by Jim Huntley,  01/11/07
%

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

nn = nn - mod(nn,m);
if(n == 0)
    pdf = modbinom1_cdf(0, nn, m, p);
end
if(n > 0)
    pdf = modbinom1_cdf(n, nn, m, p) - modbinom1_cdf(n-1, nn, m, p);
end

return


Contact us