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

gensech_cdf(x,rho,theta)
% gensech_cdf.m - compute Generalized Hyperbolic Secant Cumulative Distribution Function.
%   See "Continuous Univariate distributions", Johnson, Kotz, & Balakrishnan,
%   Wiley, V. 2, p. 148, 1995.
%
%  Created by Jim Huntley,  02/07/07
%
%   Vector Form of CDF !!!
%
%

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

return



Contact us