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

trundexp_pdf(x, mu, lambda, k);
% trundexp_pdf.m - evaluates the Truncated Double Exponential Probability Density.  
% See "http://www.math.siu.edu/olive/
% ch4.pdf#search=%22%22chapter%204%22%20%2B%22truncated%20Distributions%22%22" 
%
% Created by:   Jim Huntley,  08/22/02.
%

function [pdf] = trundexp_pdf(x, mu, lambda, k);

c = k * log(2);
coef = 1 / (2*lambda*(1-exp(-c)));
pdf = coef * exp(-abs(x-mu)/lambda);

return

Contact us