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

makeham2_cdf(x,a,b,c)
% makeham2_cdf.m - compute Makeham Cumulative Distribution Function.
%   See "Random Variable generation Using Concavity Properties of Transformed Densities", 
%   M. Evans and T. Swartz, U. Toronto.    
%
%               Vector Form of CDF !!!
%
%  Created by:  Jim Huntley,  09/11/06.
%

function [cdf] = makeham2_cdf(x,a,b,c)

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(@makeham2_pdf,minx,x(jz),tol,trace,a,b,c);
end

return



Contact us