Evaluates the F distribution CDF

View versions (1)

Interface

#include <codecogs/statistics/distributions/continuous/f/cdf.h>

using namespace Statistics::Distributions::Continuous::F;

This function evaluates the F distribution CDF.

Accuracy:

Tested at random points (m,n,x).

domain x  domain m,n  # trials     peak         rms
  0,1      1,100       100000     3.7e-14     5.9e-16
  1,5      1,100       100000     8.0e-15     1.6e-15
  0,1      1,10000     100000     1.8e-11     3.5e-13
  1,5      1,10000     100000     2.0e-11     3.0e-12

Example:

#include <stdio.h>
#include <codecogs/stats/dists/continuous/f/cdf.h>
using namespace Stats::Dists::Continuous::F;
int main()
{
  int m[10] = { 7, 7, 6, 7, 6, 7, 9, 9, 1, 11 };
  int n[10] = { 5, 8, 3, 7, 5, 5, 4, 5, 11, 8 };
  double x[10] = {0.3, 0.6, 0.9, 0.6, 0.1, 0.4, 0.8, 0.3, 1.0, 0.2 };
  for( int i=0; i<10; i++ )
    printf(  "CDF( %i, %i, %1.1f, true ) = %f \n",
      m[i], n[i], x[i], CDF( m[i], n[i], x[i] )  );
  return getchar();
}

Output:

CDF( 7, 5, 0.3, true ) = 0.926089
CDF( 7, 8, 0.6, true ) = 0.742601
CDF( 6, 3, 0.9, true ) = 0.584629
CDF( 7, 7, 0.6, true ) = 0.741755
CDF( 6, 5, 0.1, true ) = 0.992880
CDF( 7, 5, 0.4, true ) = 0.867994
CDF( 9, 4, 0.8, true ) = 0.642990
CDF( 9, 5, 0.3, true ) = 0.944103
CDF( 1, 11, 1.0, true ) = 0.338801
CDF( 11, 8, 0.2, true ) = 0.991790

Parameters

m
1st number of degrees of freedom, must be strictly positive
n
2nd number of degrees of freedom, must be strictly positive
x
the value at which to evaluate the function, must be positive
upper
Default value = false
GPL Licence — free for non commercial use. See Licence details.

Interactive Calculator

m
n
x
upper
Result