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

gengauss_cdf(x,mu,sigma,p)
% gengauss_cdf.m - compute Generalized Gaussian Cumulative Distribution Function.
%   See "A Practical Procedure to Estimate the Shape Parameter in the 
%   Generalized Gaussian Distribution", J. Armando Dominguez-Molina and 
%   R. M. Rodriguez-Dagnino, U. de Guanajuato.               
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  08/28/06.
%

function [cdf] = gengauss_cdf(x,mu,sigma,p)

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(@gengauss_pdf,minx,x(jz),tol,trace,mu,sigma,p);
end

return



Contact us