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

fermi_cdf(x,s,mu)
% fermi_cdf.m - compute Fermi-Dirac Cumulative Distribution Function.
%               See Eric W. Weisstein. "Fermi-Dirac Distribution." 
%               From MathWorld--A Wolfram Web Resource. 
%               http://mathworld.wolfram.com/Fermi-DiracDistribution.html 
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  03/11/04.
%

function [cdf] = fermi_cdf(x,s,mu)

tol = [];
trace = [];
warning off MATLAB:quad:MinStepSize;

minx = min(x);

% Integrate PDF to get CDF.
sz = size(x,2);
for jz = 1:sz
    cdf(jz) = quad(@fermi_pdf,minx,x(jz),tol,trace,s,mu);
end

return

Contact us