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

skewlapl_cdf(x, alpha, bet, mu);
% skwewlapl_cdf.m - compute Skew Laplace Cumulative Distribution Function.
%                   See http://www.maths.lth.se/help/R/.R/library/HyperbolicDist/html/dsk
%
%                   Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  03/02/05.
%

function [cdf] = skewlapl_cdf(x, alpha, bet, mu);

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

minx = min(x);
z = skewlapl_pdf(x, alpha, bet, mu);

% Integrate PDF to get CDF.
sz = size(z,2);
for jz = 1:sz
    qz(jz) = quad(@skewlapl_pdf,minx,x(jz),tol,trace,alpha,bet,mu);
end

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

return



Contact us