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

genbeta_pdf(x, a, b, c, p, q)
% genbeta_pdf.m - evaluates a Generalized Beta Probability Density.
%   See "A generalization of Generalized beta Distributions", 
%   M. B. Gordy, Fereral Reserve, 4/8/1998.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  9/18/06
%

function [pdf] = genbeta_pdf(x, a, b, c, p, q)

%persistent coef

%if(isempty(coef))
    coef = abs(a) / (b^(a*p)* beta(p,q));
%end

arg = (x./b).^a;
pdf = coef .* x.^(a*p-1) .* (1-(1-c).*arg).^(q-1) ./ (1 + c.*arg).^(p+q); 

return

Contact us