Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

James Huntley (view profile)

 

generates random variates from over 870 univariate distributions

loglapl_pdf(x, alpha, bet, delta)
% loglapl_pdf.m - evaluates a Log Laplace Probability Density.
%   See "Log-Laplace Distributions", T.J. Kozubowski & K Podgorski,
%   wolfweb.unr.edu/homepage/tkozubow/0_log1.pdf, 
%
%  Created by Jim Huntley,  12/22/08
%

function [pdf] = loglapl_pdf(x, alpha, bet, delta)

%persistent betm1 malpham1 odapb coef

%if(isempty(coef))
    betm1 = bet - 1;
    malpham1 = -alpha - 1;
    odapb = 1 / (alpha + bet);
    coef = alpha * bet * odapb / delta;
%end

for jx = 1:size(x,2)
    if(x(jx) < delta)
        pdf(jx) = coef * (x(jx)/delta)^betm1;
    else
        pdf(jx) = coef * (x(jx)/delta)^malpham1;
    end
end

return

Contact us