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

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

%if(isempty(coef))
    coef = 1 / beta(p,w);
%end

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

return

Contact us