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

nbinbet_pdf(n, nn, w, r)
% nbinbet_pdf.m - evaluates a Negative Binomial Beta Probability Density.
%   See "A Compund of the Negative Binomial Distribution with the Generalized Beta Distribution"", A.K Gupta &,
%   T. Gerstenkorn, Central European Journal of Mathematics, 2(4) 2004, p.527. 
%
%  Created by Jim Huntley,  09/29/11
%

function [pdf] = nbinbet_pdf(n, nn, w, r)

%persistent denom

%if(isempty(denom))
    denom = beta(r,w);
%end

bcnndn = binomial_coef(nn+n-1,n);
pdf = bcnndn * beta(n+r,w+nn) / denom;

return

Contact us