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

loggamma_pdf(x, gam, mu, sigma)
% loggamma_pdf.m - evaluates a Log Gamma Probability Density.
%   See "Dataplot Reference Manual, LGAPDF, Aux-265, NIST, 3/26/97.
%  Created by Jim Huntley,  8/04/04

function [pdf] = loggamma_pdf(x, gam, mu, sigma)

%persistent gamlngam

    gamlngam = gammaln(gam);

%pdf = exp(gam*(x-mu)/sigma - exp((x-mu)/sigma)) / gamma(gam);
pdf = exp(gam*(x-mu)/sigma - exp((x-mu)/sigma) - gamlngam);


Contact us