Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley (view profile)


generates random variates from over 870 univariate distributions

dbtrlapl_pdf(x, P, Q)
% dbtrlapl_pdf.m - evaluates a Doubly Truncated Laplace Probability Density.
%   See "Continuous Univariate Distributions", Johnson, Kotz and Balakrishnan,
%   Vol.2, J. Wiley, 1995, p.171.
%  Created by Jim Huntley,  10/10/08

function [pdf] = dbtrlapl_pdf(x, P, Q)

%persistent coef

    coef = 0.5 / (1-P-Q);

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


Contact us