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

laplsum_cdf(x,s1,s2)
% laplsum_cdf.m - compute Laplace Sum 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] = laplsum_cdf(x,s1,s2)

tol = 1e-8;
trace = [];
warning off MATLAB:quad:MinStepSize;

minx = min(x);

% Integrate PDF to get CDF.
warning off MATLAB:quad:MinStepSize
sz = size(x,2);
for jz = 1:sz
    cdf(jz) = quad(@laplsum_pdf,minx,x(jz),tol,trace,s1,s2);
end

% Normalize CDF.
%cdf = qz./max(qz);

return



Contact us