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

extstir1c_pdf(n, k, theta, tau)
% extstir1c_pdf.m - evaluates an Extended Stiling 1C Probability Density.
%   See "Univariate Discrete Distributions", Johnson, Kemp & Kotz,
%   J. Wiley, p.323, 2005. 
%
%  Created by Jim Huntley,  01/05/07
%

function [pdf] = extstir1c_pdf(n, k, theta, tau)

%persistent coef

% Initializations.
%if(isempty(coef))
    coef = gammaln(theta+tau);
%end

% Evaluate PDF.

%pdf = carlitz1(n-1,n-k,tau) * (n-1+tau) * coef * theta^(n-k) / gamma(theta+tau+n-1);
pdf = exp(log(carlitz1(n-1,n-k,tau) * (n-1+tau) * theta^(n-k)) + coef - gammaln(theta+tau+n));
 
return

Contact us