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

genweib_cdf(x, a, omega, nn, bet)
% genweib_cdf.m - evaluates a Generalized Weibull Cumulative Distribution.
%   See "The Amoroso Distribution", G. E. Crooks, Tech. Note 003v5 (2010-01-14)
%   http://threeplusone.com/pubs/technote/CrooksTechNote003.pdf.
%
%  Created by Jim Huntley,  10/19/11
%

function [cdf] = genweib_cdf(x, a, omega, nn, bet)

pdf = genweib_pdf(x, a, omega, nn, bet);
dx = x(2) - x(1);
sx = size(x,2);
cdf(1:sx) = 0;
for jx = 1:sx
    if(jx <= 2)
        cdf(jx) = trapz(pdf(1:jx)) * dx;
    elseif(jx > 2)
        cdf(jx) = simps(pdf(1:jx)) * dx;
    end
end


return

Contact us