Generation of Random Variates
09 Feb 2012
generates random variates from over 870 univariate distributions
% mccullagh1_cdf.m - compute McCullagh 1 Cumulative Distribution Function.
% See "Continuous Univariate Distributions", v.2, Johnson, Kotz, & Balakrishnan,
% J. Wiley, 1995, p.615 and "Some Statistical Properties of a Family of Continuous Univariate
% Distributions", P. McCullagh, U. Chicago, JASA, v.84, No.405, p.125, 1989.
% Vector Form of PDF !!!
% Created by Jim Huntley, 7/11/07
function [cdf] = mccullagh1_cdf(x,n,theta)
tol = 1e-8;
trace = ;
warning off MATLAB:quad:MinStepSize;
minx = min(x);
% Integrate PDF to get CDF.
warning off MATLAB:quad:MinStepSize
sz = size(x,2);
for jz = 1:sz
cdf(jz) = quad(@mccullagh1_pdf,minx,x(jz),tol,trace,n,theta);