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

dtrbinom_cdf(n,nn,p,r1,r2)
% dtrbinom_cdf.m - compute a Doubly Truncated Binomial Cumulative Distribution Function.
%   See "Univariate Discrete Distributions", Johnson, Kemp & Kotz,
%   J. Wiley, p.137, 2005. 
%
%  Created by Jim Huntley,  12/20/06
%

function [cdf] = dtrbinom_cdf(n,nn,p,r1,r2)

sum1 = dtrbinom_pdf(r1,nn,p,r1,r2)
for jn = r1+1:n
    sum1 = sum1 + dtrbinom_pdf(jn,nn,p,r1,r2);
end
cdf = sum1;

return



Contact us