!*********************************************************** !* This program calculates the F Distribution Q(F|nu1,nu2) * !* for F, nu1, nu2 given. * !* ------------------------------------------------------- * !* Ref.: "Numerical Recipes By W.H. Press, B.P. Flannery, * !* S.A. Teukolsky and T. Vetterling, Cambridge University * !* Press, 1986, page 166" [BIBLI 08]. * !* ------------------------------------------------------- * !* SAMPLE RUN: * !* * !* Calculate F Distribution Function Q(F|nu1,nu2) for * !* F, nu1 and nu2 given. * !* * !* Ratio F of dispersion of 1st sample / dispersion of * !* 2nd sample: 1.25 * !* * !* Degree of freedom nu1 of first sample: 25 * !* Degree of freedom nu2 of second sample: 15 * !* * !* Number of iterations: 6 * !* * !* * !* Q = 0.3323728 * !* * !* ------------------------------------------------------- * !* F90 version by J-P Moreau, Paris. * !* (www.jpmoreau.fr) * !*********************************************************** PROGRAM FDISTRI !********************************************************************** !we use the formula: Q(F|nu1,nu2) = BetaI(nu2/2,nu1/2,nu2/(nu2+nu1*F)) !********************************************************************** print *,'' print *,' Calculate F Distribution Function Q(F|nu1,nu2) for' print *,' F, nu1 and nu2 given.' print *,'' write(*,10,advance='no'); read *, f print *,'' write(*,20,advance='no'); read *, xnu1 write(*,30,advance='no'); read *, xnu2 print *,'' tmp=xnu2/(xnu2+xnu1*f) q=BETAI(xnu2/2.,xnu1/2.,tmp) print *,'' print *,'' print *,' Q = ',q print *,'' stop 10 format(' Ratio F of dispersion of 1st sample / dispersion of 2nd sample: ') 20 format(' Degree of freedom of first sample: ') 30 format(' Degree of freedom of second sample: ') END !******************************************************************* !Returns the value ln(Gamma(xx)) for xx>0. Full accuracy is obtained !for xx > 1. For 0MAXIT) then print *,' a or b too big, or MAXIT too small.' else print *,' Number of iterations: ', m end if BETACF=h return END !end of file fdistri.f90