Skip to content

FTime to event · Guide test 139

Epstein exponentiality test

Tests exponentiality using a statistic constructed from ordered lifetime observations.

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 = Epstein (Bartlett).

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 · Epstein exponentiality 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

χ² = 21.65
  1. The reference: how χ² varies across samples when H₀ is true (χ² approximation).
  2. Your statistic, from the data above.
  3. The p-value: the area at least as extreme as yours (p = .600).
  4. The hatched rejection region at α = .050: statistics landing here reject H₀.

The formula

χ2=2n(ln⁡Dˉ−ln⁡D‾)1+n+16n\chi^2=\dfrac{2n\left(\ln\bar D-\overline{\ln D}\right)}{1+\frac{n+1}{6n}}

With your numbers

χ2=21.65,n−1=24\chi^2 = 21.65,\qquad n-1 = 24
DiD_i
normalized spacings
Dˉ, ln⁡D‾\bar D,\ \overline{\ln D}
their arithmetic and log means

The verdict

χ²(24) = 21.65, p = .600

p > α = .050: compatible with H₀

Bartlett's homogeneity test applied to spacings: equal exponential spacings give a small statistic. H0 fixes no scale: every statistic uses x / x̄.

Statistic
21.655
p-value
0.5999
Epstein exponentiality test on Lifetimes: n = 25: χ²(24) = 21.65, p = .600. The p-value is above α = .050, so the data are compatible with H0.

Epstein exponentiality test on Lifetimes: n = 25: χ²(24) = 21.65, p = .600. The p-value is above α = .050, so the data are compatible 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

E=2n{log⁡(n−1∑iDi)−n−1∑ilog⁡Di}1+(n+1)/(6n)E=\frac{2n\{\log(n^{-1}\sum_iD_i)-n^{-1}\sum_i\log D_i\}}{1+(n+1)/(6n)}

Parameters and notation

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

Transform ordered lifetimes into independent exponential normalized spacings under the null, then compare the arithmetic and geometric means of those spacings through a log-ratio statistic. The supplied finite-sample multiplier supports an approximate chi-square reference.

Estimated and nuisance parameters

Common spacing scale cancels in the logarithmic arithmetic-to-geometric mean ratio. Means of spacings and log spacings are estimated summaries, not separately fitted shape parameters.

Settings and design choices

Prespecify the exact correction, upper-tail rejection, alpha and simulation option. A different definition of the initial spacing or origin changes the procedure. Numerical log evaluation must reject zero spacings rather than inserting arbitrary constants.

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.

Sensitivity and robustness

Ties or rounded-zero intervals make the statistic undefined. The exponential spacing independence is exact under its assumptions, but the resulting chi-square calibration remains approximate. Long-tailed contamination and tiny spacings can dominate the log ratio; investigate measurement precision and observation design before interpreting a large value.

How to use and calibrate

Use the approximate χ²n−1 reference or a null simulation; large values reject.

Example application

Assess equality of behavior among normalized exponential spacings.

Interpretation and pitfalls

Watch out

Zero spacings make logs undefined. The displayed reference is approximate despite the exact exponential spacing property.

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::epstein.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::epstein.exp.test(x))

Sources

  • exptest — exptest · epstein.exp.testAuthor documentation/source reviewed: exptest 1.2.rdrr.io
  • epstein.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 139, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT139.