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

arf_pdf(n, nn, k)
% arf_pdf.m - evaluates an Arfwedson Probability Density.
%   See "Generating Non-Uniform Random Variates", Chap. 10, L. Devroye
%
%  Created by Jim Huntley,  9/7/06
%

function [pdf] = arf_pdf(n, nn, k)

sum = 0;
for jn = 1:n+1
    sum = sum + (-1)^(jn-1) * ((n-jn+1)/k)^nn * binomial_coef(n,jn-1);
end    
pdf = sum * binomial_coef(k,n);

return

Contact us