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

lapldiff_pdf(x, s1, s2)
% laplsum_pdf.m - evaluates a Laplace Difference 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] = lapldiff_pdf(x, s1, s2)

%persistent coef

%if(isempty(coef))
    coef = 0.5 * s2 / (s1*(1-(s2/s1)^2));
%end

pdf = coef .* (s1 .* exp(-s2.*abs(x)) - s2 .* exp(-s1.*abs(x)));

return

Contact us