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

beta4_cdf(x, alpha, bet, a, b)
% beta4_cdf.m - evaluates a 4-Parameter Beta Cumulative Distribution.
%   See "A Compendium of Distributions", ModelRisk 3.0, Vose Software,
%   http://www.vosesoftware.com/content/ebook.pdf.
%
%  Created by Jim Huntley,  08/13/11
%

function [cdf] = beta4_cdf(x, alpha, bet, a, b)

pdf = beta4_pdf(x, alpha, bet, a ,b);

sx = size(x,2);
dx = x(2) - x(1);
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