# Noncentral F Distribution

While the F distribution characterizes how the F test statistic is distributed when the null hypothesis is assumed to be true, the noncentral F distribution instead shows how the F test statistic is distributed when the alternative hypothesis is assumed to be true (i.e. when the null hypothesis is assumed to be false). As such it is useful in calculating the power of the usual F tests (ANOVA, regression, etc.).

Definition 1: The noncentral F distribution, abbreviated as F(k1k2λ) has the cumulative distribution function F(x), written as Fk1,k2(x) when necessary, where k1k = the degrees of freedom and non-negative λ = the noncentrality parameter.

when x ≥ 0, where Ir(a,b) is the distribution function of the beta distribution

and

When x < 0, the noncentral F distribution is F(x) = 0.

Observation: The probability density function (pdf) of the noncentral F distribution can be calculated as follows:

where B(a, b) is the beta function

and Γ(k) is the gamma function. B(a, b) can be calculated in Excel by the formula

=EXP(GAMMALN(a)+GAMMALN(b)−GAMMALN(a + b))

Real Statistics Functions: The following functions are provided in the Real Statistics Pack:

NF_DIST(x, df1, df2λ, cum, iter, prec). If cum = TRUE then the value of the noncentral F distribution F(df1, df2, λ) at x is returned, while if cum = FALSE then the value of the pdf at x is returned.

NF_INV(p, df1, df2λ, iter, iter0, prec) = the inverse of the cdf of the noncentral F distribution F(df1, df2, λ) at p, i.e. the value of x such that NF_DIST(x, df1, df2λ, TRUE, iter, prec) = p.

NF_NCP(p, df1, df2, x, iter, iter0, prec) = the value of the noncentrality parameter λ such the cdf of the noncentral F distribution F(df1, df2, λ) at x is p, i.e. NF_DIST(x, df1, df2λ, TRUE, iter, prec) = p.

BETA(x, y) = beta function at x, y

Here iter = the upper limit in the infinite sum (default 1,000) and iter0 = the number of iterations used to calculate NF_INV or NF_NCP (default 40). Also the calculation of the infinite sum for the noncentral F distribution stops when the level of precision exceeds prec (default 0.000000001).

Observation: The following chart shows the graphs of the noncentral F distribution with 5, 10 degrees of freedom for λ = 0, 1, 5, 10, 20. Note that when λ = 0, the distribution is the central F distribution, i.e. F(k1k2, 0) = F(k1k2).

Figure 1 – Noncentral F pdf by noncentrality parameter

### 8 Responses to Noncentral F Distribution

1. Karol Santos says:

Hi, How are you doing?

I am looking for VBA code of the cumulative distribution function (CDF) for the noncentral F-distribution, but I have not found.

Do you have one?

Could you help me?.

Thanks so much.
Karol

• Charles says:

Karol,
The algorithm is pretty much described on the referenced webpage. If you know VBA it shouldn’t hard to implement.
Charles

• Karol Santos says:

Thanks so much!

I am looking for type error II probability, so I think that I have to use NF_NCP Function, but I have only the tree input as
df1, df2, FI and Noncentrality parameter (λ).

What does p, df1, df2, x, m, iter means?

Sorry for my lack of knowledge.

Could you help me to understand a little more

thanks so much.

Karol

• Charles says:

Karol,

These parameters are defined on the referenced webpage, but let me give you an example using the NF_NCP function, more specifically formulas of form NF_NCP(p, df1, df2, x, m, iter), which calculate the value of the noncentrality parameter lambda λ.

p = the significance level, usually referred to as alpha; most commonly p takes the value .05

df1, df2 = degrees of freedom; in fact in the standard Excel formula F.INV(p,df1, df2) for the inverse of the F distribution, the p, df1 and df2 are the same as those in the noncentrality F distribution.

x = the value of the F statistic; in fact this the same value of x that is used in the standard Excel formula F.DIST(x, df1, df2, cum) for the F distribution.

m = the upper limit in the infinite sum (1 – 170, default 40); don’t worry about this parameter, just use the default value.

iter = the number of iterations used to calculate NF_INV or NF_NCP (default 40); don’t worry about this parameter, just use the default value.

Charles

• Karol Santos says:

One more time, thanks so much,

Now I could understand how that function work.