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

gumbel_pdf(x, r)
% gumbel_pdf.m - evaluates a Gumbel Power Probability Density.
%   See "Continuous Univariate Distributions", Vol. 2, Johnson, Kemp, & Kotz, 
%   J. Wiley, p. 86, 1995.
%
%   Vector Form of PDF !!!
%
%   NOTE: distribution is not normalized !!!
%
%  Created by Jim Huntley,  3/09/07
%

function [pdf] = gumbel_pdf(x, r)

%persistent r2 gamr

%if(isempty(r2))
    r2 = 2*log(r);
    gamr = gammaln(r);
%end

pdf = exp(r2 + (-r.*x-r.*exp(-x)) - gamr);

return

Contact us