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

betasum_cdf(x,p1,q1,p2,q2)
% betasum_cdf.m - compute Beta Sum Cumulative Distribution Function.
%   See "Continuous Univariate Distributions", Johnson, Kotz, and
%   Balakrishnan, V2, J. Wiley, , p.264, 1996.               
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  11/10/06.
%

function [cdf] = betasum_cdf(x,p1,q1,p2,q2)

% Integrate PDF to get CDF.

dx = x(2) - x(1);
pdf = betasum_pdf(x,p1,q1,p2,q2);
sz = size(x,2);
for jz = 1:sz
    cdf(jz) = trapz(pdf(1:jz)) * dx;
end

return



Contact us