Define what is random before scoring a match

A numerical coincidence acquires a tail probability only after specifying a null distribution and a complete scoring procedure. For a statistic TT whose larger values mean a closer match, the null tail is

p(t)=Pr⁡H0(T≥t). p(t)=\Pr_{H_0}(T\geq t).

Under a continuous null distribution, the probability integral transform makes p(T)p(T) uniform on [0,1][0,1]. Discrete tails defined with inclusive ties are conservative: Pr⁡(p(T)≤α)≤α\Pr(p(T)\leq\alpha)\leq\alpha.

As a simple conditional example, suppose the offset RR from a fixed lattice target is uniform on [−Δ/2,Δ/2][-\Delta/2,\Delta/2]. A match at least as close as the observed offset has

p=2∣R∣Δ. p=\frac{2|R|}{\Delta}.

For a multiplicative ladder with ratio r>1r>1, a corresponding log-uniform cell has R=log⁡(x/x∗)R=\log(x/x_*) and Δ=log⁡r\Delta=\log r. This is an exact statement about that chosen cell distribution. A nonuniform ladder, measurement-error distribution, fitted anchor, or search across several targets must be included in its actual null model.

Combining independent continuous tails

Let U1,…,UkU_1,\ldots,U_k be independent uniform null probabilities. Then Yi=−log⁡UiY_i=-\log U_i obeys Pr⁡(Yi>y)=e−y\Pr(Y_i>y)=e^{-y} for y≥0y\geq0. Convolution, or multiplication of the Laplace transforms E[e−sYi]=(1+s)−1\mathbb E[e^{-sY_i}]=(1+s)^{-1}, gives

X=∑iYi∼Gamma⁡(k,1),fX(x)=xk−1e−x(k−1)!. X=\sum_iY_i\sim\operatorname{Gamma}(k,1),\qquad f_X(x)=\frac{x^{k-1}e^{-x}}{(k-1)!}.

For observed x=−∑ilog⁡pix=-\sum_i\log p_i, repeated integration by parts yields

pcombined=Pr⁡(X≥x)=e−x∑j=0k−1xjj!. \boxed{p_{\rm combined}=\Pr(X\geq x) =e^{-x}\sum_{j=0}^{k-1}\frac{x^j}{j!}.}

Equivalently 2X2X has a chi-square distribution with 2k2k degrees of freedom. Independence is essential. Several ratios using one measured anchor, or several quantities derived from one fit, generally have a joint null that must be retained.

Probability floors have atoms

Suppose a scoring rule caps the evidential contribution of each match by using U^i=max⁡(Ui,fi)\widehat U_i=\max(U_i,f_i) with a fixed 0<fi<10<f_i<1. Write ai=−log⁡fia_i=-\log f_i. Then

Y^i=−log⁡U^i=min⁡(Yi,ai). \widehat Y_i=-\log\widehat U_i=\min(Y_i,a_i).

Its probability measure consists of density e−ye^{-y} on 0≤y<ai0\leq y<a_i and an atom of mass fi=e−aif_i=e^{-a_i} at aia_i. Its Laplace transform is

E[e−sY^i]=1+se−(1+s)ai1+s, \mathbb E[e^{-s\widehat Y_i}] =\frac{1+s e^{-(1+s)a_i}}{1+s},

with a removable value at s=−1s=-1. In particular E[Y^i]=1−fi\mathbb E[\widehat Y_i]=1-f_i. The exact distribution of the sum is the convolution of these mixed measures; retaining the atoms matters at an inclusive tail threshold.

For two contributions, let

Qa(t)=Pr⁡(min⁡(Y,a)≥t)={1t≤0,e−t0<t≤a,0t>a. Q_a(t)=\Pr(\min(Y,a)\geq t)= \begin{cases} 1&t\leq0,\\e^{-t}&0<t\leq a,\\0&t>a. \end{cases}

Then the exact inclusive tail is

Pr⁡(Y^1+Y^2≥x)=∫0a1e−yQa2(x−y) dy+e−a1Qa2(x−a1). \Pr(\widehat Y_1+\widehat Y_2\geq x) =\int_0^{a_1}e^{-y}Q_{a_2}(x-y)\,dy +e^{-a_1}Q_{a_2}(x-a_1).

At x=a1+a2x=a_1+a_2 this equals f1f2f_1f_2, the mass of the joint atom. For any number of terms, X^≤X\widehat X\leq X for the same underlying uniform variables, so the ordinary gamma tail evaluated at an observed x^\widehat x is a conservative upper bound on its capped null tail. A floor chosen after inspecting the result must itself be part of the selection procedure to retain such calibration.

Repeat the whole procedure in simulation

If a numerical analysis searches over depths, index assignments, formulas, anchors, tolerances, or subsets, apply that same search to each simulated null dataset. For example, if the reported statistic is the best score T=max⁡m∈MTmT=\max_{m\in\mathcal M}T_m, the null simulation must recompute that maximum. The null model should reproduce shared errors and fitted parameters with the same fitting procedure.

This defines the object being calibrated. A selected formula cannot be treated as independently fixed merely because it can later be written without adjustable parameters. A fresh independent dataset can instead test a formula fixed before those data are examined.

Two finite-simulation quantities

For a fixed observed threshold, let KK of NN independent null simulations meet or exceed it. Conditional on that threshold, K∼Binomial⁡(N,p)K\sim\operatorname{Binomial}(N,p). If K=0K=0, solving Pr⁡p(K=0)=(1−p)N=α\Pr_p(K=0)=(1-p)^N=\alpha gives the one-sided confidence upper limit

pupper=1−α1/N≃−log⁡αN. \boxed{p_{\rm upper}=1-\alpha^{1/N} \simeq\frac{-\log\alpha}{N}.}

At 95% confidence the leading numerator is about 2.9962.996. Zero observed exceedances therefore provide a resolution bound, not a zero tail probability. For numerical stability evaluate the exact expression as −expm1⁡(log⁡α/N)-\operatorname{expm1}(\log\alpha/N).

A different question is a valid Monte Carlo hypothesis test. If the observed dataset and NN null datasets produce exchangeable statistics, the rank of the observed one is uniform among N+1N+1 distinct ranks. Its valid inclusive upper-tail Monte Carlo p-value is

pMC=K+1N+1. p_{\rm MC}=\frac{K+1}{N+1}.

Inclusive ties make it conservative. The rank argument and distinction from estimating a fixed tail are discussed by Phipson and Smyth, §§2 and 4. This p-value is not the confidence upper bound above. Exchangeability must be justified; simulating from a fitted model without reproducing the fitting process does not automatically supply it.

spectral_analysis_checks.py checks gamma tails, exact capped convolutions and atoms, finite-rank calibration, and zero-exceedance binomial coverage. These are mathematical calibration examples, with no empirical significance assigned to V2 data.