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

gamwarn_cdf(x, a, d, m, p, nn)
% gamwarn_cdf.m - compute Gamma Warning Time Cumulative Distribution Function.
%   See "Asymmetric Power Distributions: Theory and Applications to Risk Management", 
%   I. Komunjer, Caltech, web.               
%               Vector Form of CDF !!!
%  Created by:  Jim Huntley,  01/05/09.

function [cdf] = gamwarn_cdf(x, a, d, m, p, nn)

% Integrate PDF to get CDF.
dx = x(2) - x(1);
pdf = gamwarn_pdf(x,a, d, m, p, nn);
for jx = 1:size(x,2)
    if(jx <= 2)
        cdf(jx) = trapz(pdf(1:jx)) * dx;
        cdf(jx) = simps(pdf(1:jx)) * dx;


Contact us