Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates


James Huntley (view profile)


generates random variates from over 870 univariate distributions

normexpt_cdf(x, mu, sigma, k1, k2)
% normexpt_cdf.m - compute Normal Exponential T Cumulative Distribution Function.
%   See "Statistical Modeling Using GAMLSS in R", R. Rigby & M. Stasinopoulos, 
%   1 June, 2006.
%  Created by:  Jim Huntley,  11/19/07.

function [cdf] = normexpt_cdf(x, mu, sigma, k1, k2)

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


Contact us