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

laplsum_pdf(x, s1, s2)
% laplsum_pdf.m - evaluates a Laplace Sum Probability Density.
%   See "The Laplace Distribution and Generalizations", S. Kotz et al.,
%   2001, Birkhauser, p.43.
%
%   Vector Form of PDF !!!
%
%  Created by Jim Huntley,  1/24/08
%

function [pdf] = laplsum_pdf(x, s1, s2)

%persistent coef rts1s2

%if(isempty(coef))
    rts1s2 = sqrt(s1*s2);
    coef = 0.25 * rts1s2;
%end

pdf = coef .* (1 + rts1s2.*abs(x)) .* exp(-rts1s2.*abs(x));

return

Contact us