Mercurial > hg > ltpda
comparison m-toolbox/classes/+utils/@math/Fpdf.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 F distribution function | |
4 % | |
5 % CALL | |
6 % | |
7 % p = Fpdf(x,n1,n2); | |
8 % | |
9 % | |
10 % INPUT | |
11 % | |
12 % - x, F values | |
13 % - n1, degree of freedom 1 | |
14 % - n2, degree of freedom 2 | |
15 % | |
16 % References: | |
17 % [1] M. Abramowitz and I. A. Stegun, "Handbook of Mathematical | |
18 % Functions", Government Printing Office, 1964, 26.6. | |
19 % | |
20 % VERSION: $Id: Fpdf.m,v 1.3 2011/03/07 16:56:29 congedo Exp $ | |
21 % | |
22 % HISTORY: 24-02-2011 G. Congedo | |
23 % | |
24 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
25 | |
26 function p = Fpdf(x,n1,n2) | |
27 | |
28 B = beta(n1/2,n2/2); | |
29 N = n1/n2; | |
30 | |
31 p = 1/B*N^(n1/2).*x.^(n1/2-1).*(1+N.*x).^(-(n1+n2)/2); | |
32 % p = n1^(n1/2)*n2^(n2/2).*x.^(n1/2-1)./B./(n1.*x+n2).^((n1+n2)/2); | |
33 | |
34 end |