Generation of Random Variates
09 Feb 2012
generates random variates from over 870 univariate distributions
% 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
term = 2 * besselk(1,2);
coef = 1 / (1 - term);
cdf = coef * (2 * exp(-0.5*x) * besselk(1,2*exp(-0.5*x)) - term);