Mercurial > hg > ltpda
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m-toolbox/classes/+utils/@math/Fpdf.m Wed Nov 23 19:22:13 2011 +0100 @@ -0,0 +1,34 @@ +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% Compute F distribution function +% +% CALL +% +% p = Fpdf(x,n1,n2); +% +% +% INPUT +% +% - x, F values +% - n1, degree of freedom 1 +% - n2, degree of freedom 2 +% +% References: +% [1] M. Abramowitz and I. A. Stegun, "Handbook of Mathematical +% Functions", Government Printing Office, 1964, 26.6. +% +% VERSION: $Id: Fpdf.m,v 1.3 2011/03/07 16:56:29 congedo Exp $ +% +% HISTORY: 24-02-2011 G. Congedo +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +function p = Fpdf(x,n1,n2) + +B = beta(n1/2,n2/2); +N = n1/n2; + +p = 1/B*N^(n1/2).*x.^(n1/2-1).*(1+N.*x).^(-(n1+n2)/2); +% p = n1^(n1/2)*n2^(n2/2).*x.^(n1/2-1)./B./(n1.*x+n2).^((n1+n2)/2); + +end