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

invgammix_cdf.m
% invgammix_cdf.m - evaluates an Inverse Gamma Mixing Cumulative Distribution.
%   See "On Excess-of-Loss Reinsurance", H. Albrecher and J.L. Teugels,
%   Teor. ?Imovir. ta Matem. Statyst. Vip. 79, 2008, stor. 519 No. 79,
%   2008, pp. 519,
%   http://www.nbuv.gov.ua/portal/natural/Tims/2008_79/079-2.pdf.
%
%   Vector form of the CDF!!!
%
%   Created by Jim Huntley,  11/20/09
%

function [cdf] = invgammix_cdf(x, alpha, mu)

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

return

Contact us