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

bessel_pdf(n, a, nu)
% bessel_pdf.m - evaluates a Bessel Probability Density.
%   See "Simulating Bessel Random Variables", L. Devroye, 6/13/01
%
%  Created by Jim Huntley,  8/17/04
%

function [pdf] = bessel_pdf(n, a, nu)

%persistent lbesli

%if(isempty(lbesli))
    lbesli = log(besseli(nu,a));
%end

%pdf = (a/2)^(2*n + nu)/(besseli(nu,a)*factorial(n)*gamma(n+nu+1));
pdf = exp(log((a/2)^(2*n + nu)) - (lbesli + gammaln(n+1) + gammaln(n+nu+1)));

return

Contact us