Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley (view profile)


generates random variates from over 870 univariate distributions

extpower_cdf(x, theta, c, lambda, tsi)
% extpower_cdf.m - compute an Exteneded Power Cumulative Distribution Function.
%   See "Continuous Univariate Distributions", Johnson, Kotz, & Balakrishnan,
%   J. Wiley, v.1, p.63, 1995.
%   NOTE: distribution is not normalized!!!
%  Created by Jim Huntley,  01/05/07
%  Vector form of CDF!!!

function [cdf] = extpower_cdf(x, theta, c, lambda, tsi)

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(@extpower_pdf,minx,x(jz),tol,trace,theta,c,lambda,tsi);

cdf = cdf ./ max(cdf);


Contact us