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

parratio_cdf(x, a1, a2, k1, k2)
% parratio_cdf.m - evaluates a Pareto Ratio Cumulative Distribution.
%   See "Continunous Univariate Distributions", v.1, Johnson, Kotz, & Balakrishnan,
%   J. Wiley, 1995, p.606.
%
%   Creadted by:    J. Huntley,     08/08/07
%

function [cdf] = parratio_cdf(x, a1, a2, k1, k2)

%persistent coef krat oda1p2

%if(isempty(coef))
    krat = k1 / k2;
    oda1p2 = 1 /(a1+a2);
    coef = a1 * a2 * oda1p2 / krat;
%end

if(x <= krat)
    cdf = a1 * oda1p2 * (x/krat)^a2;
elseif(x > krat)
    cdf = 1 - a2 * oda1p2 * (krat/x)^a1;
end

return

Contact us