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

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

%if(isempty(coef))
    coef = 0.5 / (1-P-Q);
%end

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

return


Contact us