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

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

function [pdf] = modfelix_pdf(n, lambda, theta)

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

return

Contact us