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

bose_pdf(x,s,mu);
% bose_pdf.m - compute Bose-Einstein Probability Density Function.
%               See Eric W. Weisstein. "Fermi-Dirac Distribution." 
%               From MathWorld--A Wolfram Web Resource. 
%               http://mathworld.wolfram.com/Bose-EinsteinDistribution.html 
%
%               Vector Form of PDF !!!
%
%  Created by:  Jim Huntley,  03/11/04.
%

function [pdf] = bose_pdf(x,s,mu);

%persistent C

%if(isempty(C))
    expmu = exp(mu);
    C = 1 / (expmu*gamma(s+1)*lerch(expmu,s+1,1));
%end

sx = size(x,2);
for jx = 1:sx
    pdf(jx) = C * x(jx).^s / (exp(x(jx)+eps - mu) - 1);
end

return

Contact us