Rice's Formula for the Expected Number of Upcrossings

Contents
  1. Hypotheses and statement
  2. The joint law of the field and its derivative
  3. Kac's counting integral
  4. Taking the expectation
  5. Evaluation

This appendix proves Theorem 15.102 of Probability and Statistics: for a smooth Gaussian field of unit variance the expected number of upcrossings of a level \(z\) factorises into \(\ee^{-z^{2}/2}/(2\pi)\) times an integral of the standard deviation of the derivative, so that the level enters only through a Gaussian factor. That factorisation is what the whole look-elsewhere machinery of Section 15.6 rests on: it is what makes Theorem 15.103 true, and hence what allows a search to count upcrossings at a low threshold in a few hundred simulated experiments and extrapolate to a threshold at which nothing could ever be simulated. The formula is section 3.3 of the second instalment of Rice's memoir on random noise [Rice:1945]; the first instalment [Rice:1944] carries the shot effect and the power spectra and not this.

The proof is in three moves. A purely deterministic counting identity expresses the number of upcrossings of a \(C^{1}\) function as the limit of a normalised integral over the set where the function is near the level — Kac's device (Kac's counting integral). The expectation of that integral factorises, because a field of constant variance is uncorrelated with its own derivative at each point, and for jointly Gaussian variables uncorrelated means independent (The joint law of the field and its derivative). And the two elementary Gaussian integrals that remain are evaluated (Evaluation). The passage from the integral identity to its expectation is where Lebesgue theory enters, and it is the only thing quoted; it is stated precisely in Remark A22.7.

Hypotheses and statement

Definition A22.1 (The hypotheses).

Let \(M=[m_{1},m_{2}]\) be a compact interval and \(X\) a real-valued process on \(M\) satisfying:

  1. [(H1)] Gaussian, standardised: every finite linear combination \(\sum_{j}a_{j}X(n_{j})\), \(n_{j}\in M\), is Gaussian with mean zero; and the covariance function \(r(n,n')=\avg{X(n)X(n')}\) satisfies \(r(m,m)=1\) for every \(m\in M\).

  2. [(H2)] Smooth covariance: \(r\) is twice continuously differentiable on \(M\times M\).

  3. [(H3)] Smooth paths: almost every sample path of \(X\) is continuously differentiable on \(M\), and for each \(m\) the difference quotients \(\left(X(m+h)-X(m)\right)/h\) converge to \(X'(m)\) in mean square as \(h\rightarrow0\).

  4. [(H4)] Non-degeneracy and non-tangency: writing \(\sigma_{1}(m)^{2}=\operatorname{var}X'(m)\), the function \(\sigma_{1}\) is continuous and strictly positive on \(M\); and for the level \(z\) under consideration, almost surely there is no \(m\in M\) with \(X(m)=z\) and \(X'(m)=0\).

Rests on Definitions 15.28 and 15.100.

Theorem A22.2 (Rice's formula).

Under Definition A22.1, the expected number of upcrossings of the level \(z\) by \(X\) on \(M\), in the sense of Definition 15.100, is

\begin{equation}\tag{A22.1} \avg{N_{z}(X)}=\frac{\ee^{-z^{2}/2}}{2\pi} \int_{m_{1}}^{m_{2}}\sigma_{1}(m)\,\dd m\ep \end{equation}

Rests on Definitions 15.100 and A22.1.

The two sides carry the same SI dimension, namely none. The field is standardised, so \(X\) and the level \(z\) are pure numbers; the parameter \(m\) carries whatever unit the scanned quantity carries — in the application of Section 15.6 it is a mass — and \(X'\), being a derivative with respect to it, carries the reciprocal of that unit. So \(\sigma_{1}(m)\,\dd m\) is dimensionless, as a count must be. This is also the quickest check that no factor has been lost: the level enters only through \(\ee^{-z^{2}/2}\), which could carry no unit, and the geometry only through \(\int\sigma_{1}\,\dd m\), which is the total number of “independent looks” the scan contains.

The joint law of the field and its derivative

Lemma A22.3 (At each point, field and derivative are independent Gaussians).

Under (H1)–(H4), for each fixed \(m\in M\) the pair \(\left(X(m),X'(m)\right)\) is jointly Gaussian with mean zero and covariance matrix \(\operatorname{diag}\left(1,\sigma_{1}(m)^{2}\right)\). The two components are therefore independent, with joint density

\begin{equation}\tag{A22.2} p_{m}(v,w)=\frac{\ee^{-v^{2}/2}}{\sqrt{2\pi}}\cdot \frac{\ee^{-w^{2}/\left(2\sigma_{1}(m)^{2}\right)}} {\sqrt{2\pi}\,\sigma_{1}(m)}\ep \end{equation}

Rests on Definition A22.1 and Corollary A18.11.

Proof.

Derives Lemma A22.3. Joint Gaussianity. Fix \(a,b\in\R\) and write \(D_{h}=\left(X(m+h)-X(m)\right)/h\), a linear combination of two values of \(X\); by (H1) the variable \(S_{h}=aX(m)+bD_{h}\) is Gaussian with mean zero, say \(S_{h}\sim\mathcal{N}(0,v_{h})\). Put \(S=aX(m)+bX'(m)\). By (H3), \(D_{h}\rightarrow X'(m)\) in mean square, so \(S_{h}\rightarrow S\) in mean square and hence in probability, and therefore in distribution. Mean-square convergence also forces \(v_{h}=\avg{S_{h}^{2}}\rightarrow\avg{S^{2}}=v\), since \(\abs{\avg{S_{h}^{2}}^{1/2}-\avg{S^{2}}^{1/2}} \le\avg{(S_{h}-S)^{2}}^{1/2}\) by the triangle inequality for the second-moment norm. The characteristic function of \(S_{h}\) is \(\ee^{-v_{h}t^{2}/2}\) (Proposition 15.29 and the computation of the Gaussian transform in the derivation of Theorem 15.46), which converges to \(\ee^{-vt^{2}/2}\) for every \(t\). By Corollary A18.14 the characteristic function of \(S\) is that limit, and by Corollary A18.11 \(S\) is therefore \(\mathcal{N}(0,v)\). As \(a\) and \(b\) were arbitrary, the pair is jointly Gaussian.

The covariance vanishes. By the Cauchy–Schwarz inequality (Lemma 15.63, applied without centring, both variables having mean zero), \(\abs{\avg{X(m)\left(D_{h}-X'(m)\right)}} \le\avg{X(m)^{2}}^{1/2}\avg{\left(D_{h}-X'(m)\right)^{2}}^{1/2} \rightarrow0\), so

\begin{equation}\tag{A22.3} \avg{X(m)X'(m)}=\lim_{h\rightarrow0}\avg{X(m)D_{h}} =\lim_{h\rightarrow0}\frac{r(m,m+h)-r(m,m)}{h} =\pp_{2}r(m,m)\ec \end{equation}

where \(\pp_{2}\) is the derivative in the second slot, which exists and is continuous by (H2). Now \(r(m,m)=1\) for every \(m\) by (H1); differentiating this identity in \(m\) by the chain rule (Proposition 11.104) gives \(\pp_{1}r(m,m)+\pp_{2}r(m,m)=0\), while \(r\) is symmetric, \(r(n,n')=r(n',n)\), so \(\pp_{1}r(m,m)=\pp_{2}r(m,m)\). Hence both vanish, and \(\avg{X(m)X'(m)}=0\) by Equation (A22.3). Together with \(\operatorname{var}X(m)=r(m,m)=1\) and \(\operatorname{var}X'(m)=\sigma_{1}(m)^{2}>0\) from (H4), the covariance matrix is \(\operatorname{diag}(1,\sigma_{1}^{2})\), which is invertible.

Independence. A jointly Gaussian pair with mean zero and invertible covariance \(\Sigma\) has density \(\left(2\pi\right)^{-1}\left(\det\Sigma\right)^{-1/2} \exp\left(-\tfrac12\vect{y}\transpose\Sigma^{-1}\vect{y}\right)\); with \(\Sigma\) diagonal the quadratic form splits and the density factorises as Equation (A22.2), which by Definition 15.25 is independence.

The lemma is the structural heart of Equation (A22.1) and is worth stating in words, because it is what Theorem 15.103 exploits: constancy of the variance is what makes field and derivative independent, and once they are, the level \(z\) can influence only the first factor of Equation (A22.2) while the derivative supplies the same average slope at every level. Had the field not been standardised, the two would be correlated wherever \(\dd\operatorname{var}X/\dd m\neq0\) and no such factorisation would exist.

Kac's counting integral

The next lemma contains no probability at all. It is the observation that a transversal upcrossing contributes exactly \(2\delta\) to \(\int\indic{\abs{g-z}<\delta}(g')^{+}\), whatever \(\delta\) is, while a downcrossing contributes nothing.

Lemma A22.4 (Counting identity).

Let \(g:M\rightarrow\R\) be continuously differentiable and let \(z\in\R\) satisfy \(g(m_{1})\neq z\), \(g(m_{2})\neq z\), and \(g'(m)\neq0\) at every \(m\) with \(g(m)=z\). Then \(g\) has finitely many upcrossings of \(z\), their number \(N_{z}(g)\) in the sense of Definition 15.100 is finite, and there is \(\delta_{0}(g)>0\) with

\begin{equation}\tag{A22.4} \frac{1}{2\delta}\int_{m_{1}}^{m_{2}} \indic{\abs{g(m)-z}<\delta}\, \left(g'(m)\right)^{+}\,\dd m =N_{z}(g) \qquad\text{for every }0<\delta<\delta_{0}(g)\ec \end{equation}

where \(y^{+}=\max(y,0)\). In particular the left side converges to \(N_{z}(g)\) as \(\delta\downarrow0\). Rests on Definition 15.100, Theorem 11.43 and Theorem 11.24.

Proof.

Derives Lemma A22.4. Finiteness. Let \(Z=\set{m\in M\mid g(m)=z}\), a closed subset of the compact \(M\) and hence compact; by hypothesis it misses both endpoints. If \(p\in Z\) then \(g'(p)\neq0\), and \(g'\) is continuous, so \(g\) is strictly monotone on a neighbourhood of \(p\) and takes the value \(z\) there only at \(p\): every point of \(Z\) is isolated. A compact set all of whose points are isolated is finite — the singletons form an open cover with no proper subcover. Write \(Z=\set{p_{1}<\dots<p_{J}}\), all interior to \(M\).

A separating radius. For each \(j\) choose \(\eta>0\), the same for all \(j\), small enough that the closed intervals \(U_{j}=[p_{j}-\eta,p_{j}+\eta]\) are pairwise disjoint, contained in \((m_{1},m_{2})\), and such that \(g'\) keeps the sign of \(g'(p_{j})\) throughout \(U_{j}\); continuity of \(g'\) and finiteness of \(Z\) make this possible. On \(M\setminus\bigcup_{j}\left(p_{j}-\eta,p_{j}+\eta\right)\) — a compact set on which \(g-z\) does not vanish — the continuous function \(\abs{g-z}\) attains a strictly positive minimum \(\mu\) (Theorem 11.24). Let \(\delta_{0}=\min\left(\mu,\;\min_{j}\abs{g(p_{j}-\eta)-z},\; \min_{j}\abs{g(p_{j}+\eta)-z}\right)\), which is positive because \(g\) is strictly monotone on each \(U_{j}\) with \(g(p_{j})=z\).

The integral, for \(\delta<\delta_{0}\). The set \(A_{\delta}=\set{m\in M\mid\abs{g(m)-z}<\delta}\) is contained in \(\bigcup_{j}U_{j}\), since \(\delta<\mu\). Fix \(j\). On \(U_{j}\) the function \(g\) is strictly monotone and continuous, so \(A_{\delta}\cap U_{j}\) is the open interval \(\left(\alpha_{j},\beta_{j}\right)\) whose endpoints are the two solutions of \(g=z\mp\delta\) inside \(U_{j}\); these exist and lie in the interior of \(U_{j}\) by the intermediate value theorem (Theorem 11.23) and the choice \(\delta<\delta_{0}\).

If \(g'>0\) on \(U_{j}\) — an upcrossing at \(p_{j}\), by Definition 15.100, since \(g\) passes from below \(z\) to above it there — then \(\left(g'\right)^{+}=g'\) on \(U_{j}\) and, by the second fundamental theorem of calculus (Theorem 11.43),

\begin{equation}\tag{A22.5} \int_{\alpha_{j}}^{\beta_{j}}\left(g'(m)\right)^{+}\dd m =g(\beta_{j})-g(\alpha_{j}) =\left(z+\delta\right)-\left(z-\delta\right)=2\delta\ep \end{equation}

If instead \(g'<0\) on \(U_{j}\), then \(\left(g'\right)^{+}=0\) there and the contribution is \(0\); that is a downcrossing and is correctly not counted. Summing Equation (A22.5) over the finitely many cells, the integral in Equation (A22.4) equals \(2\delta\) times the number of \(j\) with \(g'(p_{j})>0\), which is \(N_{z}(g)\); dividing by \(2\delta\) gives the identity, with a value independent of \(\delta\).

Remark A22.5 (Why the hypotheses of the lemma are the hypotheses (H4)).

The three conditions imposed on \(g\) are exactly what (H4) and the continuity of the one-dimensional Gaussian law provide for almost every path. That \(X(m_{i})\neq z\) almost surely is immediate: \(X(m_{i})\) is standard Gaussian and \(\Pr(X(m_{i})=z)=0\) by Proposition 15.22. That no crossing is tangential is the second half of (H4), and it is assumed rather than derived — see Remark A22.7.

Taking the expectation

Theorem A22.6 (Tonelli and dominated convergence, as used here).

Let \(h(m,\omega)\ge0\) be jointly measurable on \(M\times\Omega\). Then \(\omega\mapsto\int_{M}h(m,\omega)\dd m\) and \(m\mapsto\avg{h(m,\,\cdot\,)}\) are measurable and

\begin{equation}\tag{A22.6} \avg{\int_{M}h(m,\,\cdot\,)\,\dd m} =\int_{M}\avg{h(m,\,\cdot\,)}\,\dd m\ec \end{equation}

both sides possibly infinite. And if \(Y_{\delta}\rightarrow Y\) almost surely as \(\delta\downarrow0\) with \(\abs{Y_{\delta}}\le D\) for a single \(D\) with \(\avg{D}<\infty\), then \(\avg{Y_{\delta}}\rightarrow\avg{Y}\) [Billingsley:1995]. Rests on Definition 15.4.

Remark A22.7 (What is quoted here).

Two things, and they are the only ones.

First, Theorem A22.6. Real Analysis builds the Riemann–Darboux integral and no more, so neither Tonelli's theorem nor dominated convergence is available from anything earlier in this treatise; both belong to Lebesgue theory, and the same two statements are quoted for the same reason in Remark A18.4. The interchange Equation (A22.6) is unavoidable here: the object being averaged is an integral over \(M\) of a quantity that depends on the whole path, and there is no elementary truncation — of the kind used at Equation (15.32) to avoid dominated convergence in Lemma 15.44 — that reaches it. The dominated-convergence step is the passage from Equation (A22.4), which holds path by path only for \(\delta<\delta_{0}(g)\) with a threshold that depends on the path and has no positive lower bound over all paths, to a single limit under the expectation. The dominating variable is \(D=\sup_{0<\delta<1}\left(2\delta\right)^{-1}\int_{M} \indic{\abs{X-z}<\delta}\left(X'\right)^{+}\dd m\), whose integrability is part of what is being assumed.

Second, the non-tangency half of (H4). It is stated as a hypothesis rather than derived. It is known to follow from \(\sigma_{1}^{2}>0\) together with the smoothness already assumed, by an argument (Bulinskaya's lemma) that bounds the probability of the field being near \(z\) while its derivative is near \(0\) and requires the same Lebesgue theory; this treatise does not build it, and no elementary substitute is offered. It is not a vacuous assumption: a field with a genuine tangency at level \(z\) would touch the level without crossing it, and Lemma A22.4 would fail on that path — the set \(\set{\abs{g-z}<\delta}\) would not be a finite union of monotone cells.

Everything else — the joint law Lemma A22.3, the counting identity Lemma A22.4, the two Gaussian integrals of Evaluation, and the assembly — is derived here.

Evaluation

Lemma A22.8 (The mean positive part).

If \(W\sim\mathcal{N}(0,\sigma^{2})\) with \(\sigma>0\), then \(\avg{W^{+}}=\sigma/\sqrt{2\pi}\). Rests on Definition 15.28 and Equation (11.27).

Proof.

Derives Lemma A22.8. By Equation (15.20) and the substitution \(w=\sigma y\) (Equation (11.27)),

\begin{equation*} \avg{W^{+}}=\int_{0}^{\infty}w\, \frac{\ee^{-w^{2}/\left(2\sigma^{2}\right)}} {\sqrt{2\pi}\,\sigma}\,\dd w =\frac{\sigma}{\sqrt{2\pi}}\int_{0}^{\infty} y\,\ee^{-y^{2}/2}\,\dd y =\frac{\sigma}{\sqrt{2\pi}} \left[-\ee^{-y^{2}/2}\right]_{0}^{\infty} =\frac{\sigma}{\sqrt{2\pi}}\ep \end{equation*}
Lemma A22.9 (The level factor).

Write \(\varphi(v)=\ee^{-v^{2}/2}/\sqrt{2\pi}\) for the standard Gaussian density. Then for every \(z\in\R\) and \(\delta>0\) there is \(\zeta_{\delta}\in[z-\delta,z+\delta]\) with

\begin{equation}\tag{A22.7} \frac{1}{2\delta}\Pr\!\left(\abs{X(m)-z}<\delta\right) =\varphi(\zeta_{\delta})\ec \qquad \abs{\varphi(\zeta_{\delta})-\varphi(z)}\;\le\; \frac{\delta}{\sqrt{2\pi\ee}}\ec \end{equation}

and the bound does not depend on \(m\). Rests on Definition 15.28 and Theorem 11.35.

Proof.

Derives Lemma A22.9. By (H1) the variable \(X(m)\) is standard Gaussian for every \(m\), so \(\Pr(\abs{X(m)-z}<\delta)=\int_{z-\delta}^{z+\delta}\varphi(v)\dd v\), independently of \(m\). Since \(\varphi\) is continuous, the mean value theorem for integrals — apply Theorem 11.35 to the antiderivative \(\Phi\), whose derivative is \(\varphi\) by Proposition 15.22 — gives \(\int_{z-\delta}^{z+\delta}\varphi=2\delta\,\varphi(\zeta_{\delta})\) for some \(\zeta_{\delta}\) in the interval. Applying Theorem 11.35 once more, this time to \(\varphi\) itself, \(\abs{\varphi(\zeta_{\delta})-\varphi(z)}\le\delta\sup_{v} \abs{\varphi'(v)}\), and \(\varphi'(v)=-v\varphi(v)\) has modulus maximised at \(v=\pm1\), where it equals \(\ee^{-1/2}/\sqrt{2\pi}\).

Proof of Theorem A22.2. Derives Theorem A22.2. By (H3) and Remark A22.5, almost every sample path satisfies the hypotheses of Lemma A22.4, so almost surely

\begin{equation}\tag{A22.8} N_{z}(X)=\lim_{\delta\downarrow0}Y_{\delta}\ec \qquad Y_{\delta}=\frac{1}{2\delta}\int_{m_{1}}^{m_{2}} \indic{\abs{X(m)-z}<\delta}\left(X'(m)\right)^{+}\dd m\ep \end{equation}

Take expectations. The dominated-convergence clause of Theorem A22.6 gives \(\avg{N_{z}(X)}=\lim_{\delta\downarrow0}\avg{Y_{\delta}}\), and the Tonelli clause — the integrand is non-negative — gives, for each fixed \(\delta\),

\begin{equation}\tag{A22.9} \avg{Y_{\delta}}=\frac{1}{2\delta}\int_{m_{1}}^{m_{2}} \avg{\indic{\abs{X(m)-z}<\delta}\left(X'(m)\right)^{+}}\,\dd m\ep \end{equation}

At each fixed \(m\) the indicator is a function of \(X(m)\) alone and the positive part a function of \(X'(m)\) alone, and those two are independent by Lemma A22.3; so the expectation factorises, and by Lemmas A22.8 and A22.9,

\begin{equation}\tag{A22.10} \frac{1}{2\delta} \avg{\indic{\abs{X(m)-z}<\delta}\left(X'(m)\right)^{+}} =\varphi(\zeta_{\delta})\, \frac{\sigma_{1}(m)}{\sqrt{2\pi}}\ep \end{equation}

From Equations (A22.2) and (A22.9) (factorise the expectation at each \(m\) by independence, then evaluate the level factor and the mean positive part). The point \(\zeta_{\delta}\) does not depend on \(m\) (Lemma A22.9), so it comes outside the integral:

\begin{equation}\tag{A22.11} \avg{Y_{\delta}}=\frac{\varphi(\zeta_{\delta})}{\sqrt{2\pi}} \int_{m_{1}}^{m_{2}}\sigma_{1}(m)\,\dd m\ec \end{equation}

the integral being finite because \(\sigma_{1}\) is continuous on the compact \(M\) (H4) and therefore bounded and Riemann integrable (Theorem 11.40). Letting \(\delta\downarrow0\) and using the uniform estimate of Equation (A22.7),

\begin{equation*} \avg{N_{z}(X)}=\frac{\varphi(z)}{\sqrt{2\pi}} \int_{m_{1}}^{m_{2}}\sigma_{1}(m)\,\dd m =\frac{\ee^{-z^{2}/2}}{2\pi} \int_{m_{1}}^{m_{2}}\sigma_{1}(m)\,\dd m\ec \end{equation*}

since \(\varphi(z)/\sqrt{2\pi}=\ee^{-z^{2}/2}/(2\pi)\). That is Equation (A22.1).

Corollary A22.10 (The stationary case).

If in addition \(X\) is stationary, so that \(r(n,n')\) depends only on \(n-n'\), then \(\sigma_{1}\) is the constant \(\sqrt{\lambda_{2}}\) with \(\lambda_{2}=-r''(0)\), and

\begin{equation}\tag{A22.12} \avg{N_{z}(X)}=\frac{L}{2\pi}\sqrt{\lambda_{2}}\;\ee^{-z^{2}/2}\ec \qquad L=m_{2}-m_{1}\ep \end{equation}

Rests on Theorem A22.2.

Proof.

Derives Corollary A22.10. With \(D_{h}\) as in Lemma A22.3, the second-moment norm is continuous under mean-square convergence, so \(\avg{D_{h}D_{h'}}\rightarrow\avg{X'(m)^{2}}\) as \(h,h'\rightarrow0\). On the other hand

\begin{equation}\tag{A22.13} \avg{D_{h}D_{h'}} =\frac{r(m+h,m+h')-r(m+h,m)-r(m,m+h')+r(m,m)}{h\,h'}\ec \end{equation}

a second-order difference quotient of the twice continuously differentiable \(r\), which converges to \(\pp_{1}\pp_{2}r(m,m)\). Hence \(\sigma_{1}(m)^{2}=\pp_{1}\pp_{2}r(m,m)\) in general. Now write \(r(n,n')=\varrho(n-n')\) with \(\varrho\) twice continuously differentiable by (H2) and \(\varrho(0)=1\); then \(\pp_{1}r=\varrho'(n-n')\) and \(\pp_{2}\pp_{1}r=-\varrho''(n-n')\), so \(\sigma_{1}(m)^{2}=-\varrho''(0)=\lambda_{2}\), independent of \(m\), and the integral in Equation (A22.1) is \(L\sqrt{\lambda_{2}}\).

Remark A22.11.

Rice's Formula for the Expected Number of Upcrossings discharges the proof obligation of Theorem 15.102 in Section 15.6.2 of Probability and Statistics, the last of the results that section had to import. With it, the chain the look-elsewhere effect rests on is complete: Davies' bound Theorem 15.101 was already derived there from the intermediate value theorem and Markov's inequality; Theorem 15.103 — the exponential level dependence \(\avg{N_{u}}=\avg{N_{u_{0}}}\ee^{-(u-u_{0})/2}\), which is what lets a search estimate a trials factor from upcrossings counted at a one-sigma threshold — follows from Equation (A22.1) at \(z=\sqrt{u}\); and Corollary 15.105 follows from those two. What is assumed and not proved is named in Remark A22.7: two theorems of Lebesgue theory, and the absence of tangential crossings. The extension of Theorem 15.103 to a scan over several parameters remains, as Remark 15.104 says, reported and not derived — and nothing in this treatise uses it.