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

etamu_pdf(x, eta, mu)
% etamu_pdf.m - evaluates a Eta - Mu Probability Density.
%   See "The  Eta - Mu Distribution: A General Fading Distribution", 
%   M. D. Yacoub, U. Campinas, VTC 2000.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  09/19/06
%

function [pdf] = etamu_pdf(x, eta, mu)

%persistent h H coef tmu

%if(isempty(h))
    h = 0.25 * (2 + eta + 1/eta);
    H = 0.25 * (1/eta - eta);
    coef = exp(log(4 * sqrt(pi) * mu^(mu+0.5) * h^mu) - (log(H^(mu-0.5)) + gammaln(mu)));
    tmu = 2 * mu;
%end

sx = size(x,2);

for jx = 1:sx
    x2 = x(jx)^2;
    pdf(jx) = coef * exp(-tmu*h*x2) * x2^mu * besseli(mu-0.5,tmu*H*x2);    
end 

return

Contact us