diff m-toolbox/classes/+utils/@math/Finv.m @ 0:f0afece42f48

Import.
author Daniele Nicolodi <nicolodi@science.unitn.it>
date Wed, 23 Nov 2011 19:22:13 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m-toolbox/classes/+utils/@math/Finv.m	Wed Nov 23 19:22:13 2011 +0100
@@ -0,0 +1,33 @@
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Compute inverse of the cumulative F distribution function
+% 
+% CALL 
+% 
+% x = Finv(p,n1,n2);
+% 
+% 
+% INPUT
+% 
+% - p, probability
+% - n1, degree of freedom 1
+% - n2, degree of freedom 2
+% 
+% References:
+%   [1] William H. Press, Saul A. Teukolsky, William T. Vetterling, Brian
+%   P. Flannery, NUMERICAL RECIPES, Cambridge University Press, 2007
+% 
+%
+% L Ferraioli 06-12-2010
+%
+% $Id: Finv.m,v 1.1 2010/12/06 19:14:36 luigi Exp $
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+function x = Finv(p,n1,n2)
+
+u = betaincinv(p,n1/2,n2/2);
+x = n2.*u./(n1.*(1-u));
+
+end
+
+