Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley (view profile)


generates random variates from over 870 univariate distributions

binbet_pdf(n, nn, w, p)
% binbet_pdf.m - evaluates a Compound Binomial Beta Probability Density.
%   See "Handbook of Beta Distribution and Its Applications", A.K Gupta &,
%   S. Nadarajah, p.140, 2004. 
%  Created by Jim Huntley,  09/29/11

function [pdf] = binbet_pdf(n, nn, w, p)

%persistent coef

    coef = 1 / beta(p,w);

bcnndx = binomial_coef(nn,n);
pdf =  coef * bcnndx * beta(p+n,nn+w-n);


Contact us