Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

 

generates random variates from over 870 univariate distributions

wilhil_cdf(x,alpha,theta)
% wilhil_cdf.m - compute Wilson Hilferty 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/18/10.
%

function [cdf] = wilhil_cdf(x,alpha,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(@wilhil_pdf,minx,x(jz),tol,trace,alpha,theta);
end

return



Contact us