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

dbpar_cdf(x, alpha, bet)
% dbpar_cdf.m - tests a Double Pareto Cumulative Distribution.
%   See "The Double Pareto-Lognormal Distribution - 
%   A New Parametric Model for Size Distributions", W.J Reed & M. Jorgensen,
%   http://citeseer.ist.psu.edu/691544.html
%
%   Created by: J. Huntley, 02/20/08
%

function [cdf] = dbpar_cdf(x, alpha, bet)

%persistent coef

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

for jx = 1:size(x,2)
    if(x(jx) > 0 && x(jx) <= 1)
        cdf(jx) = coef * x(jx)^bet / bet;
    elseif(x(jx) > 1)
        cdf(jx) = 1 - coef * x(jx)^(-alpha) / alpha;
    end
end

return

Contact us