Skip to content

FTime to event · Guide test 132

Gnedenko exponentiality F test

Tests exponentiality by comparing functions of normalized ordered spacings.

Runs in CodeSplashPython (calls R) example not runR example not run

Do it in CodeSplash

In the app, set it up in Analyze with this method:

In Exponentiality tests (battery), choose Test = Gnedenko F.

Do it in CodeSplash Run this test on your own data, in Python or R.

Bench

Change the design, drag the data, move α. The statistic, its reference distribution and the verdict follow.

Bench · Gnedenko exponentiality F test

25
1.60

1 is the exponential (constant hazard); above 1 wear-out, below 1 early failures.

2.0
0.050

Your data

Weibull lifetimes; shape 1 is exponential
Lifetimes · n = 25 · mean 2.07

If H₀ were true

F = 2.67
  1. The reference: how F varies across samples when H₀ is true, F(24, 26), both tails (exact under exponentiality: normalized spacings are independent exponentials).
  2. Your statistic, from the data above.
  3. The p-value: the area at least as extreme as yours (p = .016).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The formula

F=1r∑i≤rDi1n−r∑i>rDi∼F2r, 2(n−r)F=\dfrac{\frac1r\sum_{i\le r}D_i}{\frac{1}{n-r}\sum_{i>r}D_i}\sim F_{2r,\,2(n-r)}

With your numbers

F=2.67,F24, 26F = 2.67,\qquad F_{24,\,26}
DiD_i
normalized spacings (n − i + 1)(x₍ᵢ₎ − x₍ᵢ₋₁₎)
rr
split point ⌊n/2⌋

The verdict

F = 2.67, p = .016

p ≤ α = .050: reject H₀

Under exponentiality the normalized spacings are independent exponentials, so the ratio is exactly F. Small F: early spacings shrink (increasing hazard). H0 fixes no scale: every statistic uses x / x̄.

Statistic
2.667
p-value
0.0164
Gnedenko exponentiality F test on Lifetimes: n = 25: F = 2.67, p = .016. The p-value is below α = .050, so the data are hard to reconcile with H0.

Gnedenko exponentiality F test on Lifetimes: n = 25: F = 2.67, p = .016. The p-value is below α = .050, so the data are hard to reconcile with H₀.

Question and hypotheses

H0: Xi are exponential with some common mean θ>0; H1: a departure detectable by this statistic.

Assumptions

Independent identically distributed positive, uncensored observations. The null is an exponential distribution with unknown scale and known origin zero. Censored, shifted or dependent samples need specialized versions.

Formula

Q=R−1∑i=1RDi(n−R)−1∑i=R+1nDiQ=\frac{R^{-1}\sum_{i=1}^{R}D_i}{(n-R)^{-1}\sum_{i=R+1}^{n}D_i}

Parameters and notation

Choose an integer 1≤R<n before looking at the result. Di=(n−i+1)[X(i)−X(i−1)], X(0)=0. Under H0 these normalized spacings are independent exponentials with the same mean.

Structure of the method

Sort complete lifetimes, compute risk-set-weighted adjacent spacings, split them after a fixed rank R, and ratio the two segment means. Under an exponential null the normalized spacings are independent same-scale exponentials, producing an exact F ratio at fixed R.

Estimated and nuisance parameters

No explicit exponential-scale estimate is required because the ratio cancels it. The order statistics and weighted spacings are computed data transformations; the split rank R is not estimated under the null.

Settings and design choices

Choose an integer R between one and n−1, the direction or two-sided rule, and alpha beforehand. The package rounds its default split; an explicit integer is clearer for reproducibility and odd sample sizes.

Fitting and adaptation

There is no neural fitting or fine-tuning stage. For an unknown-scale exponential null, exploit scale invariance or re-estimate the mean in every simulated unit-exponential sample, exactly matching the observed-data algorithm. Calibrate the prespecified tail and repeat the entire procedure after changing a tuning rule. Report simulation count and Monte Carlo uncertainty; use a plus-one randomized p-value convention for newly implemented Monte Carlo tests. For this exact fixed-R ratio, the F reference avoids Monte Carlo error when its assumptions hold.

Sensitivity and robustness

Ties create zero spacings and change the independent continuous-spacing law. An arbitrary unknown threshold is not a known zero origin. Scanning many split points while using the most significant fixed-R p-value inflates false positives; calibrate the maximum or minimum-p search if that is the intended statistic.

How to use and calibrate

Exactly Q~F2R,2(n−R) under the continuous exponential null; choose the prespecified tail(s).

Example application

Compare early and late normalized spacings for a change from constant hazard.

Interpretation and pitfalls

Watch out

Searching over R and using a fixed-R F p value inflates false positives. Rounding and tied lifetimes can invalidate exactness.

What changed in edition 2

  • New sections: structure of the method, estimated and nuisance parameters, settings and design choices, fitting and adaptation, sensitivity and robustness.

Python and R

Uses exptest 1.2 (archived CRAN package); see installation notes. Complete positive uncensored lifetimes, unknown exponential scale and known origin zero. Defaults and tail calibration follow the cited function.

Python · invokes R

Not run — Python launcher syntax checked; R backend runtime not verified · needs Python standard library + Rscript; R packages: exptest

# Python launcher for the complete R implementation below.
# Requires Rscript on PATH and the listed R packages.
import shutil
import subprocess
rscript = shutil.which("Rscript")
if rscript is None:
    raise RuntimeError("Install R and make Rscript available on PATH.")
r_code = r"""
set.seed(2026)
x<-rexp(24,rate=2)
print(exptest::gnedenko.exp.test(x))
"""
# No shell interpolation. A failed R execution raises an error in Python.
result = subprocess.run([rscript, "--vanilla", "-"], input=r_code,
                        text=True, capture_output=True)
print(result.stdout)
if result.stderr:
    print(result.stderr)
result.check_returncode()
R

Not run — Syntax checked; runtime not verified in the final environment · needs exptest

set.seed(2026)
x<-rexp(24,rate=2)
print(exptest::gnedenko.exp.test(x))

Sources

  • exptest — exptest · gnedenko.exp.testAuthor documentation/source reviewed: exptest 1.2.rdrr.io
  • gnedenko.exp.testrdrr.io
Statistics guide v4 (historical):
Python: Python launcher syntax checked; R backend runtime not verified · R: Syntax checked; runtime not verified in the final environment
Reference's record:
Edition 2 review: Python: skip · R: not executed (Rscript unavailable); why not run: Python: Python-to-R bridge; Rscript is unavailable. R code was not executed. Python: Not run in the reference's review: Python-to-R bridge; Rscript is unavailable. R code was not executed. R: Reviewed but not run: R wasn't available to the reference's authors.

From the CodeSplash statistics guide (v4), entry 132, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT132.