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

mxgenbet_cdf(x, p, q, a, b, c)
% mxgenbet_cdf.m - evaluates a McDonald & Xu Generalized Beta Cumulative Distribution.
%   See "Handbook of Beta Distribution and Its Applications", A.K Gupta &,
%   S. Nadarajah, p.125, 2004.
%
%  Created by Jim Huntley,  09/13/11
%

function [cdf] = mxgenbet_cdf(x, p, q, a, b, c)

pdf = mxgenbet_pdf(x, p, q, a, b, c);

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