Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

 

generates random variates from over 870 univariate distributions

hyperlog_pdf(n, lambda, bet)
% hyperlog_pdf.m - evaluates a Hyperlogrithmic Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp & Kotz,
%   J. Wiley, p. 320, 2005.
%
%  Created by Jim Huntley,  3/21/07
%

function [pdf] = hyperlog_pdf(n, lambda, bet)

%persistent coef lgbet

%if(isempty(coef))
    coef = exp(gammaln(lambda+1) - log(genHyper([1 1],lambda+1,bet)));
    lgbet = log(bet);
%end

pdf = coef * exp(gammaln(n) + (n-1)*lgbet - gammaln(lambda+n));

return

Contact us