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

limpolya_cdf(x,a,c,d,bet,r)
% limpolya_cdf.m - compute Limiting Polya-Type Cumulative Distribution Function.
%   See "Continuous Univariate Distributions", Johnson, Kotz and Balakrishnan,
%   1995, J. Wiley, v.1, p.56.
%
%   Vector Form of CDF !!!
%
%  Created by Jim Huntley,  1/24/08
%

function [cdf] = limpolya_cdf(x,a,c,d,bet,r)

pdf = limpolya_pdf(x,a,c,d,bet,r);
sz = size(x,2);
dx = x(2) - x(1);
for jz = 1:sz
    if(jz <= 2)
        cdf(jz) = trapz(pdf(1:jz)) * dx;
    elseif(jz > 2)
        cdf(jz) = simps(pdf(1:jz)) * dx;
    end
end

return



Contact us