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

binomdiff_cdf(n,N1,p1,N2,p2)
% binomdiff_cdf.m - compute Binomial Difference Cumulative Distribution Function.
%   See "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
%   J. Wiley, p.142, 2005.                  
%
%  Created by:  Jim Huntley,  11/21/06.
%

function [cdf] = binomdiff_cdf(n,N1,p1,N2,p2)

sum1 = binomdiff_pdf(-N2, N1, p1, N2, p2);

for jn = 1:n+N2
    sum1 = sum1 + binomdiff_pdf(jn-N2, N1, p1, N2, p2);
end

cdf = sum1;

return



Contact us