Code covered by the BSD License  

Highlights from
Generation of Random Variates

image thumbnail

Generation of Random Variates

by

 

generates random variates from over 870 univariate distributions

distgam_cdf(x, a, d, m, p)
% distgam_cdf.m - compute Distended Gamma 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] = distgam_cdf(x, a, d, m, p)

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

return



Contact us