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

claplnorm_cdf(x,sigma,tsi,phi)
% claplnorm_cdf.m - compute Compund Laplace Normal Cumulative Distribution Function.
%   See "Continuous Univariate Distributions", Vol.2, Johnson, Kotz &
%   Balakrishnan, p.194, 1995.
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  04/02/09.
%

function [cdf] = claplnorm_cdf(x,sigma,tsi,phi)

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(@claplnorm_pdf,minx,x(jz),tol,trace,sigma,tsi,phi);
end

return



Contact us