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

range_cdf(x)
% range_cdf.m - evaluates a Range Cumulative Distribution.
%   See "Continuous Univariate Distributions", Johnson, Kotz, and Balakrishnan,
%   J. Wiley, v.2, p.87, 1995.
%
%  Created by Jim Huntley,  9/28/07
%
% Note that normalized has been applied to this function!!!
%

function [cdf] = range_cdf(x)

persistent term coef

if(isempty(coef))
    term = 2 * besselk(1,2);
    coef = 1 / (1 - term);
end

cdf = coef * (2 * exp(-0.5*x) * besselk(1,2*exp(-0.5*x)) - term);

return

Contact us