Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

James Huntley (view profile)

 

generates random variates from over 870 univariate distributions

trnegbin_cdf(n,Q,k)
% trnegbin_cdf.m - compute Truncated negative Binomial Cumulative Distribution Function.
%   See " Univariate Discrete Distributions", Johnson, Kotz, and Balakrishnan,
%   J. Wiley, p.233, 2005.
%
%    Created by:    J. Huntley,  10/11/2007
%

function [cdf] = trnegbin_cdf(n,Q,k)

sum1 = 0;
for jn = 1:n
    sum1 = sum1 + trnegbin_pdf(jn,Q,k);
end
cdf = sum1;

return



Contact us