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

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

function [cdf] = loglapl_cdf(x, alpha, bet, delta)

%persistent odapb coef

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

for jx = 1:size(x,2)
    if(x(jx) < delta)
        cdf(jx) = alpha * odapb * (x(jx)/delta)^bet;
    else
        cdf(jx) = 1 - bet * odapb * (x(jx)/delta)^(-alpha);
    end
end

return

Contact us