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

airy_cdf(x)
% airy_cdf.m - evaluates an Airy Cumulative Distribution.
%   See "Airy Distribution Function: From the Area under a Brownian
%   Excursion to the Maximal Height of Fluctuating Interfaces", S.N. Majumdar
%   & A.Comtet, http://arxiv.org/PS_cache/cond-mat/pdf/0409/0409566v2.pdf, 1994. 
%
%  Created by Jim Huntley,  06/07/11
%

function [cdf] = airy_cdf(x)

pdf = airy_pdf(x);
sx = size(x,2);
cdf(1:sx) = 0;
dx = x(2) - x(1);

for jx = 1:sx
    if(jx <= 2)
        cdf(jx) = trapz(pdf(1:jx)) * dx;
    elseif(jx > 2)
        cdf(jx) = simps(pdf(1:jx)) * dx;
    end
end

return

Contact us