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

gengum_pdf(x, nn, lambda, u)
% gengum_pdf.m - tests a Generalized Gumbel Probability Density.
%   See "The Amoroso Distribution", G. E. Crooks, Tech. Note 003v5 (2010-01-14)
%   http://threeplusone.com/pubs/technote/CrooksTechNote003.pdf.
%
%  Created by Jim Huntley,  10/19/11
%

function [pdf] = gengum_pdf(x, nn, lambda, u)

%persistent coef

%if(isempty(coef))
    coef = nn^nn / (gamma(nn)*abs(lambda)); 
%end

argx = (x-u) ./ lambda;
pdf = coef .* exp(-nn.*argx-nn.*exp(-argx));

return

Contact us