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

dismaxent_pdf(n, q, lambda, nmin, nmax)
% dismaxent_pdf.m - evaluates a Discrete Maximum Entropy Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp, and Kotz,
%   2005, J. Wiley, p.475.
%
%  Created by Jim Huntley,  01/23/08
%

function [pdf] = dismaxent_pdf(n, q, lambda, nmin, nmax)

%persistent norm

%if(isempty(norm))
    norm = 0;
    for jn = nmin:nmax
        norm = norm + lambda^jn * q^(0.5*jn*(jn-1));
    end
%end
        
pdf =  lambda^n * q^(0.5*n*(n-1)) / norm;

return


Contact us