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

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

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

%persistent lcoef

% Initializations.
%if(isempty(lcoef))
    coef = theta^k * gamma(theta+tau);
    lcoef = log(theta^k) + gammaln(theta+tau);
%end

% Evaluate PDF.

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

return

Contact us