function theResult = fisher(f, v1, v2)

% fisher -- Fisher's F distribution.
%  fisher(f, v1, v2) integrates the Fisher F probability
%   density function Q(F | v1, v2), using the incomplete
%   beta function, as per formula (6.3.11) in Press, et al.,
%   "Numerical Recipes", 1986.  The integration is from
%   f to Inf.
 
% Copyright (C) 1999 Dr. Charles R. Denham, ZYDECO.
%  All Rights Reserved.
%   Disclosure without explicit written consent from the
%    copyright owner does not constitute publication.
 
% Version of 20-Jan-1999 11:08:25.

if nargout > 0, theResult = []; end

if nargin < 3, help(mfilename), return, end

if ischar(f), f = eval(f); end
if ischar(v1), v1 = eval(v1); end
if ischar(v2), v2 = eval(v2); end

v = v2 ./ (v2 + v1 .* f);

result = betainc(v, v2 ./ 2, v1 ./ 2);

if nargout > 0
	theResult = result;
else
	disp(result)
end
