Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley (view profile)


generates random variates from over 870 univariate distributions

genlogn_pdf(x, tau, sigma, mu)
% genlogn_pdf.m - evaluates a Generalized Lognormal Probability Density.
%   See "The Generalized Lognormal Distribution as an Income Distribution", 
%   C. Kleiber and S. Scheid, Dortmund,.               
%               Vector Form of CDF !!!
%  Created by:  Jim Huntley,  10/30/08.

function[pdf] = genlogn_pdf(x, tau, sigma, mu)

%persistent coef denom

    coef = (log(0.5) - (log(tau)/tau+log(sigma)+gammaln(1+(1/tau))));
    denom = 1 / (tau*sigma^tau);

pdf =  exp(coef - denom.*(abs(log(x)-mu)).^tau - log(x));


Contact us