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

carlitz2(n, m, x)
% carlitz2.m - evaluates the Stirling-Carlitz Type 2 polymonial coefficients.
%   See "The r-Stirling Numbers", Andrei Z. Broder, Stanford, December, 1982, eq. 57.
%
%   Created by: J. Huntley,  01/05/07
%
%   Calls:  'stirling2.m'
%

function [r2] = carlitz2(n, m, x)

sumk = 0;
for jk = 1:n+1
    sumk = sumk + binomial_coef(n,jk-1) * stirling2(n-jk+1,m) * x^(jk-1);
end
r2 = sumk;

return

Contact us