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

extstir2f_pdf(n, nn, m, tau)
% extstir2f_pdf.m - evaluates an Extended Stiling 2F Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp & Kotz,
%   J. Wiley, p.323, 2005. 
%
%  Created by Jim Huntley,  01/08/07
%

function [pdf] = extstir2f_pdf(n, nn, m, tau)

%persistent coef

% Initializations.
%if(isempty(coef))
    %coef = factorial(m) / (m+tau)^nn;
    coef = gammaln(m+1) - nn*log(m+tau);
%end

% Evaluate PDF.

%pdf = carlitz2(nn,n,tau) * coef / factorial(m-n);
pdf = exp(log(carlitz2(nn,n,tau)) + coef - gammaln(m-n+1));

return

Contact us