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_pdf(x, alpha)
% flimit_pdf.m - evaluates an F Limit Probability Density.
%   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[pdf] = flimit_pdf(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

pdf = x.^(ad2-1) ./ (pi.*sinpd2a.*(1+((x.^ad2+cospd2a)./sinpd2a).^2));

return



Contact us