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

betageom_pdf(n, alpha, bet)
% betageom_pdf.m - evaluates a Beta Geometric Probability Density.
%   See "A Compendium of Distributions", ModelRisk 3.0, Vose Software,
%   http://www.vosesoftware.com/content/ebook.pdf.
%
%  Created by Jim Huntley,  08/13/11
%

function [pdf] = betageom_pdf(n, alpha, bet)

%persistent coef

%if(isempty(coef))
    coef = bet * exp(gammaln(alpha+bet) - gammaln(alpha));
%end    

pdf = coef * exp(gammaln(alpha+n) - gammaln(alpha+bet+n+1));

return

Contact us