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

kdist_pdf(x, c, nu)
% kdist_pdf.m - evaluates a K-Distribution.
%   See "Non-linear Interference ...", Ponnekanti & Sali, PIER 18, 209 (1998).
%
%  Created by Jim Huntley,  10/13/03
%

function [pdf] = kdist_pdf(x, c, nu)

%persistent gamlnnu

%if(isempty(gamlnnu))
    gamlnnu = gammaln(nu);
%end

arg = 2*c*x;
%pdf = 4*c*(c*x)^nu * besselk(nu-1,arg) / gamma(nu);
pdf = exp(log(4*c*(c*x)^nu) + log(besselk(nu-1,arg)) - gamlnnu);

return 

Contact us