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

delfelix_pdf(n, lambda, nn)
% delfelix_pdf.m -evaluates a Delta Felix Probability Density.
%   See "Lagrangian Probability Distributions", P.C. Consul & F. Famoye,
%   Birkhauser, 2006, Table 2.2.
%
%   Doesn't normalize for lambda >~ 0.5!!!
%
%  Created by Jim Huntley,  11/13/08
%

function [pdf] = delfelix_pdf(n, lambda, nn)

%pdf = nn * (n*lambda)^((n-nn)/2) * exp(-n*lambda) / (n*gamma((n-nn+2)/2));
pdf = nn * exp(((n-nn)/2)*log(n*lambda) - n*lambda - (log(n)+gammaln((n-nn+2)/2)));

return

Contact us