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

revgum_cdf(x, mu, sigma)
% revgum_cdf.m - compute reverse Gumbel Cumulative Distribution Function.
%   See "Statistical Modeling Using GAMLSS in R", R. Rigby & M. Stasinopoulos, 
%   p.50, 1 June, 2006.
%
%  Created by:  Jim Huntley,  11/19/07.
%

function [cdf] = revgum_cdf(x, mu, sigma)

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

return




Contact us