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

devyld_cdf(x, s)
% devyld_cdf.m - evaluates a DeVylder Cumulative Distribution.
%   See "DeVylder Approximations to the Moments and Distribution
%   of the Time to Ruin,", D. C. DicKson and K. S. Wong.
%
%  Created by Jim Huntley,  09/22/06
%
%

function [cdf] = devyld_cdf(x, s)

%persistent a a1 a2

%if(isempty(a))
    a = 0.5 + sqrt(0.25-2/(7+s^2));
    a1 = 1 / (1-a);
    a2 = 1 / a1;
%end

cdf = 1 - a.*exp(-a1.*x) - (1-a).*exp(-a2.*x);

return

Contact us