Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

James Huntley (view profile)

 

generates random variates from over 870 univariate distributions

mccullagh2_cdf(x,n,theta)
% mccullagh2_cdf.m - compute McCullagh 2 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] = mccullagh2_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(@mccullagh2_pdf,minx,x(jz),tol,trace,n,theta);
end

return



Contact us