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

lambdamu_pdf(x, lambda, mu)
% lambdamu_pdf.m - evaluates a Lambda - Mu Probability Density.
%   See "The  Lambda - Mu General Fading Distribution", 
%   G. Fraidenraich and M. D. Yacoub, U. Campinas, Proc. SBMO/IEEE MTT-5 IMOC 2003.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  09/19/06
%

function [pdf] = lambdamu_pdf(x, lambda, mu)

%persistent arg coef tmu

%if(isempty(arg))
    arg = 1-lambda^2;
    %coef = 4 * sqrt(pi) * mu^(mu+0.5) / (lambda^(mu-0.5)*sqrt(arg)*gamma(mu));
    coef = exp(log(4 * sqrt(pi) * mu^(mu+0.5)) - log(lambda^(mu-0.5)*sqrt(arg)) + gammaln(mu));
    tmu = 2 * mu;
%end

pdf = coef .* exp(-tmu.*x.^2/arg) .* x.^tmu .* besseli(mu-0.5,tmu*lambda.*x.^2./arg);  

return

Contact us