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

stacy_cdf(x,alpha,bet,theta,xtrem)
% stacy_cdf.m - compute Stacy Cumulative Distribution Function.
%   See "The Amoroso Distribution", G. E. Crooks, Tech. Note 003v5 (2010-01-14)
%   http://threeplusone.com/pubs/technote/CrooksTechNote003.pdf.              
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  2/17/10.
%

function [cdf] = stacy_cdf(x,alpha,bet,theta,xtrem)

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(@stacy_pdf,minx,x(jz),tol,trace,alpha,bet,theta,xtrem);
end

return



Contact us