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

ved_pdf(n, p, m)
% test_ved.m - tests a Ved Probability Density.
%   See "Lagrangian Probability Distributions", P.C. Consul & F. Famoye,
%   Birkhauser, 2006, Table 2.1.
%
%   Doesn't normalize for p <~ 0.67 + 0.33*(m-1)/m !!!
%
%  Created by Jim Huntley,  11/11/08
%

function [pdf] = ved_pdf(n, p, m)

q = 1 - p;
ratio = q / p;

pdf = exp(gammaln(m*n+1) - gammaln((n-1)/3+1) - gammaln(m*n-(n-1)/3+1) + ...
         (m*n)*log(p) + ((n-1)/3)*log(ratio) - log(n));

end

Contact us