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

genbeta2_pdf(x, a, b, gam)
% genbeta2_pdf.m - evaluatess a Generalized Beta II Probability Density.
%   See "A Generalized Beta Distribution II",  S. Nadarajah and S. Kotz 
%   http://interstat.statjournals.net/YEAR/2003/articles/0312002.pdf.
%
%  Created by Jim Huntley,  02/09/10
%

function [pdf] = genbeta2_pdf(x, a, b, gam)

%persistent coef

%if(isempty(coef))
    coef = b * beta(a,b) / beta(a,b+gam);
%end

pdf = coef .* x.^(a+b-1) .* pfq([1-gam,a],a+b,x);

return

Contact us