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

flimit_cdf(x, alpha)
% flimit_cdf.m - evaluates an F Limit Cumulative Distribution.
%   See "Continuous Univariate Distributions", Johnson, Kotz & Balakrishnan,
%   Vol. 2, J. Wiley, 1995, p.352.
%
%   Note: PDF in text does not appear to be correct!!!
%
%  Created by Jim Huntley,  11/15/06
%

function[cdf] = flimit_cdf(x, alpha)

%persistent pa sinpd2a cospd2a ad2

%if(isempty(pa))
    pa = pi*alpha;
    sinpd2a = sin(0.5*pa);
    cospd2a = cos(0.5*pa);
    ad2 = 0.5 * alpha;
%end

cdf = 2 .* atan2(x.^(ad2)+cospd2a,sinpd2a) ./ pa - 1/alpha + 1;

return



Contact us