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

laplmsum_cdf(x,n)
% laplmsum_cdf.m - compute Laplace Multiple Sum (Unit Std Dev) Cumulative Distribution Function.
%   See "The Laplace Distribution and Generalizations", S. Kotz et al.,
%   2001, Birkhauser, p.43.             
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  01/24/08.
%

function [cdf] = laplmsum_cdf(x,n)

pdf = laplmsum_pdf(x,n);
sz = size(x,2);
dx = x(2) - x(1);
for jz = 1:sz
    if(jz <= 2)
        cdf(jz) = trapz(pdf(1:jz)) * dx;
    elseif(jz > 2)
        cdf(jz) = simps(pdf(1:jz)) * dx;
    end
end

return



Contact us