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

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

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

bcnndx = binomial_coef(nn,n);
sumk = 0;
for jk = 1:n+1
    k = jk - 1;
    sumk = sumk + binomial_coef(n,k) * (m-1)^(nn-n+k) * beta(p+k,nn+w-n);
end
pdf = sumk * bcnndx / (beta(p,w)*m^nn);

return

Contact us