Generation of Random Variates
09 Feb 2012
generates random variates from over 870 univariate distributions
% beta2mix_cdf.m - compute binomial Mixture of Beta2 Cumulative Distribution Functions.
% See "Continuous Univariate Distributions", Johnson, Kotz, and
% Balakrishnan, V2, J. Wiley, , p.250, 1996.
% Vector Form of CDF !!!
% Created by: Jim Huntley, 10/30/06.
function [cdf] = beta2mix_cdf(x,nn,p,a,b)
% Integrate PDF to get CDF.
dx = x(2) - x(1);
pdf = beta2mix_pdf(x,nn,p,a,b);
sz = size(x,2);
for jz = 1:sz
cdf(jz) = trapz(pdf(1:jz)) * dx;