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

laplprod_cdf(x, s1, s2)
% test_laplprod.m - evaluates a Laplace Difference Cumulative Distribution.
%   See "The Laplace Distribution and Generalizations", S. Kotz et al.,
%   2001, Birkhauser, p.43.
%
%  Created by Jim Huntley,  12/15/08
%

function [cdf] = laplprod_cdf(x, s1, s2)

if(x >= 0)
    cdf = 1 - sqrt(abs(x)./(s1*s2)).*besselk(1,2.*sqrt(abs(x)./(s1*s2)));
elseif(x < 0)
    cdf = sqrt(abs(x)./(s1*s2)).*besselk(1,2.*sqrt(abs(x)./(s1*s2)));
end

return

Contact us