comparison 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
comparison
equal deleted inserted replaced
-1:000000000000 0:f0afece42f48
1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2 %
3 % Compute inverse of the cumulative F distribution function
4 %
5 % CALL
6 %
7 % x = Finv(p,n1,n2);
8 %
9 %
10 % INPUT
11 %
12 % - p, probability
13 % - n1, degree of freedom 1
14 % - n2, degree of freedom 2
15 %
16 % References:
17 % [1] William H. Press, Saul A. Teukolsky, William T. Vetterling, Brian
18 % P. Flannery, NUMERICAL RECIPES, Cambridge University Press, 2007
19 %
20 %
21 % L Ferraioli 06-12-2010
22 %
23 % $Id: Finv.m,v 1.1 2010/12/06 19:14:36 luigi Exp $
24 %
25 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
26 function x = Finv(p,n1,n2)
27
28 u = betaincinv(p,n1/2,n2/2);
29 x = n2.*u./(n1.*(1-u));
30
31 end
32
33