FTime to event · Guide test 130
Henze–Meintanis exponentiality tests
Use empirical transform discrepancies based on characterizations of the exponential distribution.
Do it in CodeSplash
In the app, set it up in Analyze with this method:
- Exponentiality tests (battery) — Could these lifetimes be exponential, with a constant failure rate?
In Exponentiality tests (battery), choose Test = Henze–Meintanis, exponential weight.
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 · Henze–Meintanis exponentiality tests
1 is the exponential (constant hazard); above 1 wear-out, below 1 early failures.
Weight function
Your data
Weibull lifetimes; shape 1 is exponentialIf H₀ were true
- The reference: how T varies across samples when H₀ is true, simulated: 999 exponential samples of 25 (simulated null on the shared Wichmann–Hill stream).
- Your statistic, from the data above.
- The p-value: the area at least as extreme as yours (p = .008).
- The hatched rejection region at α = .050: statistics landing here reject H₀.
The formula
With your numbers
- empirical characteristic function of the scaled data
- the weight: exp(−t) or exp(−t²)
The verdict
T = 0.41, p = .008
p ≤ α = .050: reject H₀
An integrated characteristic-function distance; consistent against every alternative. The null is simulated. H0 fixes no scale: every statistic uses x / x̄.
- Statistic
- 0.412
- p-value
- 0.0080
Henze–Meintanis exponentiality tests on Lifetimes: n = 25: T = 0.41, p = .008. 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
Parameters and notation
φn(t)=n⁻¹Σexp(itYi), Cn=Re φn. The EWGoF HM variants use exponential/Gaussian weights, wa(t)=e^(−at) or e^(−at²), up to matching constant normalization; a>0.
Structure of the method
Construct an empirical characteristic function of mean-standardized lifetimes and integrate a weighted squared exponential-characterization discrepancy. The EWGoF W1/W2 labels select specific weight forms; expanded pairwise or higher-order sums evaluate the integral without a naive frequency grid.
Estimated and nuisance parameters
The exponential mean is a nuisance estimate; empirical transform values are computed summaries. The weight decay a is a prespecified design parameter, and no nonexponential shape model is fitted.
Settings and design choices
Specify the exact W variant, weight function, positive a, integration/closed-form convention and Monte Carlo budget. Smaller weight decay places relatively more emphasis on higher frequencies and can increase numerical or sampling variability.
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
Literature surnames do not uniquely identify a formula: preserve the source equation and software label together. Searching across a values or W variants requires joint calibration. High-frequency emphasis is sensitive to rounding, and computational cost can grow steeply with n; subsampling the statistic needs fresh validation.
How to use and calibrate
Reject for large T using null simulation with fixed a. Other Henze–Meintanis papers use related sine/cosine or Laplace characterizations; identify the paper and statistic.
Example application
Test exponential fit with a transform discrepancy sensitive beyond a few moments.
Interpretation and pitfalls
Watch out
The surname family does not identify one equation. This entry follows the catalog’s EWGoF HM labeling; do not mix its labels with another paper’s calibration.
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
EWGoF labeling: W1 for the squared-modulus HM family; T1 for the sine–cosine MI family. Tuning parameter a=1 is fixed in advance. Only 199 simulations are used for a quick demonstration; increase for final inference.
Not run — Python launcher syntax checked; R backend runtime not verified · needs Python standard library + Rscript; R packages: EWGoF
# 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(20,rate=2)
print(EWGoF::CF.test(x,type="W1",a=1,nsim=199))
"""
# 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()
Not run — Syntax checked; runtime not verified in the final environment · needs EWGoF
set.seed(2026)
x<-rexp(20,rate=2)
print(EWGoF::CF.test(x,type="W1",a=1,nsim=199))
Sources
- EWGoF — EWGoF · CF.testAuthor documentation/source reviewed: EWGoF 2.2.2.search.r-project.org
- doi.org/10.1007/s001840400322doi.org
- CF.testsearch.r-project.org
- s001840400322doi.org
- 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 130, updated from the reference's edition 2 (reviewed 14 November 2026) as STAT130.