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

gennakag_pdf(x, s, m, omega)
% gennakag_pdf.m - evaluates a Generalized Nakagami Probability Density.
%   See "Modeling the Amplitude Statistics of Ultrasonic Images", 
%   T. Eltoft, U. Tromso, IEEE Trans. Med. imaging, Vol. 25, No. 2, February, 2006.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  9/22/06
%

function [pdf] = gennakag_pdf(x, s, m, omega)

%persistent twos coef

%if(isempty(coef))
    twos = 2 * s;
    coef = exp(log(twos * m^m) - (gammaln(m) + m*log(omega)));
%end 

sx = size(x,2);

for jx = 1:sx
    pdf(jx) = coef * x(jx)^(twos*m-1) * exp(-m*x(jx)^twos/omega);    
end 

return

Contact us