Introduction
Functional data analysis (FDA) has emerged as one of the most active areas of statistical research over the past decades, driven by the increasing availability of data collected over time, space, or other continuous domains. In contrast to classical multivariate statistics, where each data point is a vector, the FDA framework treats each observation as a curve, surface, or more general function, typically viewed as a realization of an underlying stochastic process. This paradigm shift has enabled more nuanced analyses in diverse fields including climatology, biomechanics, neuroimaging, and econometrics, where the fundamental units of observation are inherently functional ([58 ] ). The monograph by Ramsay and Silverman [51 ] is generally regarded as a standard reference for the subject, while detailed up-to-date accounts of the theory and applications are provided for example by Horváth and Kokoszka [27 ] , Hsing and Eubank [28 ] or Wang et al. [60 ] .
© José R. Berrendero, Antonio Coín and Antonio Cuevas.
License: CC-BY 4.0, see https://creativecommons.org/licenses/by/4.0/ .
A core problem in statistics involves hypothesis testing for quantities of interest. As such, considerable efforts have been devoted to generalizing classical testing frameworks to functional data, providing p p p -values and decision rules based on asymptotic approximations or bootstrap resampling. These methods include frequentist two-sample tests [19 , 24 , 64 ] , analysis of variance methods [15 , 14 , 65 ] , change point detection procedures [2 , 25 ] , repeated measures analysis [44 , 56 ] or dependence tests in linear regression [9 , 34 ] , among others. However, the conceptually simpler one-sample tests, often used to detect the presence or absence of a certain effect within a given population, have received less attention in the FDA literature. Notable exceptions include proposals by Mas [45 ] , Munk et al. [49 ] and Zhang [65 ] , where the authors explore different tests for the mean of a functional sample.
On the other hand, Bayesian methods for hypothesis testing—introduced in modern form by Jeffreys [30 ] —are extensively studied and applied in multivariate settings, offering a principled alternative to the often criticized p p p -value approach [see 53 , 54 and references therein] . However, despite their broad adoption, they remain comparatively underdeveloped within the FDA framework. We aim to bridge this gap by proposing a Bayesian test for the mean function μ \mu μ of a Gaussian process observed through i.i.d. samples, which serves as a building block for more complex statistical analyses and machine learning applications. In particular, we provide a method for testing the point-null hypothesis H 0 : μ ≡ μ 0 H_0 : \mu\equiv\mu_0 H 0 : μ ≡ μ 0 versus the composite alternative H 1 : μ ≢ μ 0 H_1 : \mu\not\equiv\mu_0 H 1 : μ ≡ μ 0 , where μ 0 ( ⋅ ) \mu_0(\cdot) μ 0 ( ⋅ ) is a predetermined function. We focus on the simple hypothesis of exact equality, in contrast to precise or relevant hypotheses such as H 0 ε : ∥ μ − μ 0 ∥ < ε H_0^\varepsilon: \lVert\mu-\mu_0\rVert< \varepsilon H 0 ε : ∥ μ − μ 0 ∥ < ε for a given ε > 0 \varepsilon> 0 ε > 0 . Although these precise hypothesis may be useful when an exact zero is not meaningful or reasonable, in a Bayesian framework they can be conceptually encoded in the corresponding point-null hypothesis via prior beliefs, as argued by Berger and Delampady [1 ] . The proposed test is based on the so-called Bayes factor , which is defined as
B F 10 = P ( d a t a ∣ H 1 ) P ( d a t a ∣ H 0 ) \mathrm{BF}_{10} = \frac{\mathbb{P}(\mathrm{data}\mid H_1)}{\mathbb{P}(\mathrm{data}\mid H_0)} BF 10 = P ( data ∣ H 0 ) P ( data ∣ H 1 )
and measures the evidence for H 1 H_1 H 1 over H 0 H_0 H 0 . It is linked to the prior and posterior odds through the formula
P ( H 1 ∣ d a t a ) P ( H 0 ∣ d a t a ) = B F 10 × P ( H 1 ) P ( H 0 ) . \frac{\mathbb{P}(H_1\mid\mathrm{data})}{\mathbb{P}(H_0\mid\mathrm{data})}
= \mathrm{BF}_{10} \times\frac{\mathbb{P}(H_1)}{\mathbb{P}(H_0)}. P ( H 0 ∣ data ) P ( H 1 ∣ data ) = BF 10 × P ( H 0 ) P ( H 1 ) .
Using Bayes factors to quantify the evidence against the null hypothesis in a continuous manner is the standard approach in Bayesian testing, popularized since the seminal work by Kass and Raftery [33 ] . Because they are intimately related to the posterior probability of the null, Bayes factors provide a direct probabilistic way of interpreting the test decision, while also allowing the incorporation of prior information. Moreover, despite being a loose analog of a likelihood ratio test, the Bayes factor B F 10 \mathrm{BF}_{10} BF 10 can be inverted to provide evidence in favor of H 0 H_0 H 0 , which is not possible in frequentist tests due to the built-in asymmetry.
Most functional tests in the literature employ some form of dimension reduction via projections or basis expansions as a first step. We take a slightly different approach and follow earlier work by Berrendero et al. [4 , 5 ] . In particular, we directly assume that the mean function is a member of the reproducing kernel Hilbert space (RKHS) associated with the covariance function of the underlying Gaussian process, so that it can be approximated through a finite linear combination of kernel sections. We will see that this assumption is reasonable and allows us to completely specify a Bayesian test, circumventing the difficulty of placing a prior distribution on an infinite-dimensional space, and providing a closed-form likelihood expression via Radon–Nikodym derivatives. Since we do not restrict ourselves to conjugate models, we use the reversible jump variant of Markov chain Monte Carlo methods (RJMCMC), proposed by Green [23 ] , to approximate the posterior distribution. From this approximation we obtain estimators of the posterior probability of the null hypothesis and the Bayes factor, which can be used to guide decision-making while explicitly accounting for uncertainty.
To validate the methodology from a theoretical point of view, we study the large-sample consistency of our test and measure the speed of posterior concentration. This technique has become a standard tool in the frequentist assessment of Bayesian procedures, as exemplified by the highly relevant work of Ghosal and van der Vaart [21 ] . Posterior consistency of the Bayes factor in a point-null testing situation was established by Dass and Lee [16 ] , but their abstract approach cannot provide posterior contraction rates. As a novel contribution, we show that under H 0 H_0 H 0 the posterior probability of the alternative goes to zero at a polynomial rate, while under H 1 H_1 H 1 the posterior probability of the null decays exponentially fast. On the other hand, finite-sample performance is evaluated by numerical simulations in terms of frequentist metrics, such as type I error (false positive rate), type II error (false negative rate) or power (true positive rate).
Preliminaries and Notation
Consider a fixed time horizon T > 0 T > 0 T > 0 and suppose our data comes from a Gaussian process X = { X ( t ) : t ∈ [ 0 , T ] } X = \{X(t) : t \in[0,T]\} X = { X ( t ) : t ∈ [ 0 , T ]} , with mean function μ ( t ) = E [ X ( t ) ] \mu(t) = \mathbb{E}[X(t)] μ ( t ) = E [ X ( t )] and covariance function K ( t , s ) = E [ ( X ( t ) − μ ( t ) ) ( X ( s ) − μ ( s ) ) ] K(t,s) = \mathbb{E}[(X(t) - \mu(t))(X(s) - \mu(s))] K ( t , s ) = E [( X ( t ) − μ ( t )) ( X ( s ) − μ ( s ))] . For convenience, assume that the sample paths of X X X are continuous almost surely, so point evaluation is well-defined. We will mainly work with functional observations, but whenever discretization is needed we will suppose that the process is observed on an arbitrarily dense grid S = { s 1 , … , s G } ⊂ [ 0 , T ] S = \{s_1,\ldots,s_G\} \subset[0,T] S = { s 1 , … , s G } ⊂ [ 0 , T ] of size G G G .
To construct the RKHS H ( K ) \mathcal{H}(K) H ( K ) associated with K K K , we first consider the functional space H 0 ( K ) \mathcal{H}_0(K) H 0 ( K ) of all finite linear combinations of evaluations of K K K , that is,
H 0 ( K ) = { ∑ j = 1 p β j K ( t j , ⋅ ) : p ∈ N , β j ∈ R , t j ∈ [ 0 , T ] } . \mathcal{H}_0(K) = \left\{ \sum_{j=1}^{p} \beta_j K(t_j,\cdot) : p \in\mathbb{N},\ \beta_j \in\mathbb{R},\ t_j \in[0,T] \right\}. H 0 ( K ) = { j = 1 ∑ p β j K ( t j , ⋅ ) : p ∈ N , β j ∈ R , t j ∈ [ 0 , T ] } .
This space is endowed with the inner product ⟨ f , g ⟩ K = ∑ j , k β j γ k K ( t j , u k ) \langle f,g\rangle_K = \sum_{j,k} \beta_j\gamma_k K(t_j,u_k) ⟨ f , g ⟩ K = ∑ j , k β j γ k K ( t j , u k ) , given that f ( ⋅ ) = ∑ j β j K ( t j , ⋅ ) f(\cdot) = \sum_j \beta_j K(t_j,\cdot) f ( ⋅ ) = ∑ j β j K ( t j , ⋅ ) and g ( ⋅ ) = ∑ k γ k K ( u k , ⋅ ) g(\cdot) = \sum_k \gamma_k K(u_k,\cdot) g ( ⋅ ) = ∑ k γ k K ( u k , ⋅ ) . Then, H ( K ) \mathcal{H}(K) H ( K ) is defined as the completion of H 0 ( K ) \mathcal{H}_0(K) H 0 ( K ) with respect to this inner product. We remark that functions on this space satisfy the reproducing property: ⟨ K ( t , ⋅ ) , f ⟩ K = f ( t ) \langle K(t,\cdot),f\rangle_K = f(t) ⟨ K ( t , ⋅ ) , f ⟩ K = f ( t ) for all f ∈ H ( K ) f \in\mathcal{H}(K) f ∈ H ( K ) and t ∈ [ 0 , T ] t \in[0,T] t ∈ [ 0 , T ] ; we refer the reader to the monograph by Berlinet and Thomas-Agnan [3 ] for further details.
As it turns out, this RKHS is isometrically isomorphic to the closed linear span of the process X X X in the space of all random variables with finite second moment. This congruence is realized through Loève’s isometry Ψ X \Psi_X Ψ X (Berlinet and Thomas-Agnan [3 ] , Theorem 35), which can be seen as the completion of the correspondence ∑ j β j K ( t j , ⋅ ) ⟷ ∑ j β j X ( t j ) \sum_j \beta_j K(t_j,\cdot) \longleftrightarrow\sum_j \beta_j X(t_j) ∑ j β j K ( t j , ⋅ ) ⟷ ∑ j β j X ( t j ) . Despite the close relation between the process and the space H ( K ) \mathcal{H}(K) H ( K ) , concrete trajectories x = X ( ω ) x=X(\omega) x = X ( ω ) do not belong to H ( K ) \mathcal{H}(K) H ( K ) with probability one, except in trivial cases [43 Corollary 7.1] . Thus, the expression ⟨ x , f ⟩ K \langle x,f\rangle_K ⟨ x , f ⟩ K for f ∈ H ( K ) f\in\mathcal{H}(K) f ∈ H ( K ) is ill-defined when x x x is a realization of X X X . However, we can still make sense of this expression by following the approach of Parzen [50 ] , identifying ⟨ X , f ⟩ K \langle X,f\rangle_K ⟨ X , f ⟩ K with the random variable Ψ X ( f ) \Psi_X(f) Ψ X ( f ) through Loève’s isometry. We adopt this interpretation hereafter.
Throughout this paper we will work with column vectors, denoting the transpose of a vector v v v by v ′ v' v ′ and its Euclidean norm by ∥ v ∥ \lVert v\rVert ∥ v ∥ . By a slight abuse of notation, arbitrary matrix norms will be equally denoted by ∥ ⋅ ∥ \lVert\cdot\rVert ∥ ⋅ ∥ , while the symbol ∥ ⋅ ∥ K \lVert\cdot\rVert_K ∥ ⋅ ∥ K is reserved for the norm of H ( K ) \mathcal{H}(K) H ( K ) . An uppercase Π \Pi Π will stand for prior distributions or their corresponding densities, and similarly Π n \Pi_n Π n will represent a posterior distribution (or density) based on n n n observations. Moreover, by convention, boldface letters will designate discretized functional quantities on the grid S \mathcal{S} S .
Organization of the Paper
In § 2 we describe the proposed methodology and RKHS modeling assumptions for our Bayesian test. § 3 explores the asymptotic properties of the test from a frequentist perspective, and § 4 is concerned with numerical experiments and a real data application. In § 5 we summarize the main findings and discuss future work. A description of the proposed RJMCMC scheme is included in Appendix § 7 , while Appendix B contains the proofs of the theoretical results. Lastly, further details on the experimentation framework are available in Appendix § 9 .
A Reproducing Kernel Approach to Bayesian Testing
Let X 1 : n = ( X 1 , … , X n ) X_{1:n}=(X_1,\ldots,X_n) X 1 : n = ( X 1 , … , X n ) be an i.i.d. sample of a Gaussian process X ∼ GP ( μ , K ) X\sim\operatorname{GP}(\mu,K) X ∼ GP ( μ , K ) with mean μ \mu μ and strictly positive definite covariance function K K K , which is assumed to be known for the time being. Without loss of generality we set μ 0 ≡ 0 \mu_0\equiv0 μ 0 ≡ 0 and T = 1 T=1 T = 1 , which leads us to consider the hypotheses
H 0 : μ ( t ) = 0 for all t ∈ [ 0 , 1 ] against H 1 : μ ( t ) ≠ 0 for some t ∈ [ 0 , 1 ] . \begin{aligned}
H_0 &: \mu(t)=0 \text{ for all } t\in[0,1] \quad\text{against} \quad H_1 : \mu(t)\ne0 \text{ for some } t\in[0,1].
\end{aligned} H 0 : μ ( t ) = 0 for all t ∈ [ 0 , 1 ] against H 1 : μ ( t ) = 0 for some t ∈ [ 0 , 1 ] .
Our key modeling assumption is that μ ∈ H ( K ) \mu\in\mathcal{H}(K) μ ∈ H ( K ) . Not only is this space naturally linked to the process X X X , but in general it contains smoother functions than, say, L 2 [ 0 , 1 ] L^2[0,1] L 2 [ 0 , 1 ] . More importantly, it provides a direct finite-dimensional representation of the mean function if we further suppose that μ ∈ H 0 ( K ) \mu\in\mathcal{H}_0(K) μ ∈ H 0 ( K ) , which is dense in H ( K ) \mathcal{H}(K) H ( K ) by construction. Indeed, we propose a parametric model (with a functional interpretation) based on the approximation
μ θ ( ⋅ ) = ∑ j = 1 p β j K ( t j , ⋅ ) , (1) \mu_\theta(\cdot)=\sum_{j=1}^{p}\beta_j K(t_j,\cdot), \tag*{(1)} μ θ ( ⋅ ) = j = 1 ∑ p β j K ( t j , ⋅ ) , (1)
where θ = ( p , τ p , b p ) \theta=(p,\tau_p,b_p) θ = ( p , τ p , b p ) is a generic parameter, with τ p = ( t 1 , … , t p ) ∈ [ 0 , 1 ] p \tau_p=(t_1,\ldots,t_p)\in[0,1]^p τ p = ( t 1 , … , t p ) ∈ [ 0 , 1 ] p the time instants, b p = ( β 1 , … , β p ) ∈ R p b_p=(\beta_1,\ldots,\beta_p)\in\mathbb{R}^p b p = ( β 1 , … , β p ) ∈ R p the coefficients and p ∈ N p\in\mathbb{N} p ∈ N the dimensionality (which is not fixed). We will omit the subscript p p p when it is understood from context, and assume that the grid of observation S \mathcal{S} S is fine enough to contain all the relevant time instants.
Note that when K K K is strictly positive definite, the null hypothesis μ θ ≡ 0 \mu_\theta\equiv0 μ θ ≡ 0 corresponds to b = 0 b=0 b = 0 as long as the time instants are distinct. Thus, the parameter spaces for the null and alternative hypotheses in our Bayesian test are
Θ 0 = ⋃ p ∈ N { b ∈ R p : b = 0 } and Θ 1 = ⋃ p ∈ N { ( p , τ , b ) : τ ∈ T p , b ∈ R p ∖ { 0 } , \Theta_0=\bigcup_{p\in\mathbb{N}}\{b\in\mathbb{R}^p:b=0\}\quad\text{and}\quad\Theta_1=\bigcup_{p\in\mathbb{N}}\{(p,\tau,b):\tau\in\mathcal{T}_p,\ b\in\mathbb{R}^p\setminus\{0\}, Θ 0 = p ∈ N ⋃ { b ∈ R p : b = 0 } and Θ 1 = p ∈ N ⋃ {( p , τ , b ) : τ ∈ T p , b ∈ R p ∖ { 0 } ,
respectively, where T p = { ( t 1 , … , t p ) ∈ [ 0 , 1 ] p : t 1 < ⋯ < t p } \mathcal{T}_p=\{(t_1,\ldots,t_p)\in[0,1]^p:t_1<\cdots<t_p\} T p = {( t 1 , … , t p ) ∈ [ 0 , 1 ] p : t 1 < ⋯ < t p } is the ordered unit simplex. Although not strictly needed, we impose an ordering constraint to avoid identifiability issues and reduce the parameter space by a factor of p ! p! p ! on each dimension.
Likelihood and Prior Distributions
Let P μ \mathbb{P}_\mu P μ be the distribution of GP ( μ , K ) \operatorname{GP}(\mu,K) GP ( μ , K ) on the path space C [ 0 , 1 ] \mathcal{C}[0,1] C [ 0 , 1 ] (continuous functions on [ 0 , 1 ] [0,1] [ 0 , 1 ] ), and similarly let P 0 \mathbb{P}_0 P 0 be the distribution of GP ( 0 , K ) \operatorname{GP}(0,K) GP ( 0 , K ) . Since both distributions are Gaussian with common covariance, the Feldman–Hájek dichotomy (Feldman, 1958) implies that P μ \mathbb{P}_\mu P μ is absolutely continuous with respect to P 0 \mathbb{P}_0 P 0 whenever μ ∈ H ( K ) \mu\in\mathcal{H}(K) μ ∈ H ( K ) , which is precisely our assumption on the mean function. In this situation, the density of P μ θ \mathbb{P}_{\mu_\theta} P μ θ with respect to P 0 \mathbb{P}_0 P 0 is given by [4 Theorem 1]
d P μ θ d P 0 ( X ) = exp { ⟨ X , μ θ ⟩ K − 1 2 ∥ μ θ ∥ K 2 } . (2) \frac{\mathrm{d}\mathbb{P}_{\mu_\theta}}{\mathrm{d}\mathbb{P}_0}(X)=\exp\left\{\langle X,\mu_\theta\rangle_K-\frac{1}{2}\|\mu_\theta\|_K^2\right\}. \tag*{(2)} d P 0 d P μ θ ( X ) = exp { ⟨ X , μ θ ⟩ K − 2 1 ∥ μ θ ∥ K 2 } . (2)
In a Bayesian setting, this Radon–Nikodym derivative can be interpreted as the likelihood L ( X ∣ θ ) L(X\mid\theta) L ( X ∣ θ ) of observing a path X X X under the parameter μ θ \mu_\theta μ θ , with respect to the common reference measure P 0 \mathbb{P}_0 P 0 . Now, since μ θ \mu_\theta μ θ has the finite-dimensional representation (1) , we can evaluate the scalar product (via Loève’s isometry) and the RKHS norm, obtaining closed-form expressions ⟨ X , μ θ ⟩ K = ∑ j = 1 p β j X ( t j ) \langle X,\mu_\theta\rangle_K=\sum_{j=1}^p\beta_jX(t_j) ⟨ X , μ θ ⟩ K = ∑ j = 1 p β j X ( t j ) and ∥ μ θ ∥ K 2 = ∑ j = 1 p ∑ k = 1 p β j β k K ( t j , t k ) \|\mu_\theta\|_K^2=\sum_{j=1}^p\sum_{k=1}^p\beta_j\beta_kK(t_j,t_k) ∥ μ θ ∥ K 2 = ∑ j = 1 p ∑ k = 1 p β j β k K ( t j , t k ) . In particular, for our i.i.d. sample the joint likelihood becomes
L ( X 1 : n ∣ p , τ , b ) = exp { S n ( τ ) ′ b − n 2 b ′ K τ b } , (3) L(X_{1:n}\mid p,\tau,b)=\exp\left\{S_n(\tau)^\prime b-\frac{n}{2}b^\prime K_\tau b\right\}, \tag*{(3)} L ( X 1 : n ∣ p , τ , b ) = exp { S n ( τ ) ′ b − 2 n b ′ K τ b } , (3)
where S n ( τ ) = ∑ i = 1 n ( X i ( t 1 ) , … , X i ( t p ) ) ′ S_n(\tau)=\sum_{i=1}^n(X_i(t_1),\ldots,X_i(t_p))^\prime S n ( τ ) = ∑ i = 1 n ( X i ( t 1 ) , … , X i ( t p ) ) ′ and K τ = [ K ( t j , t k ) ] j , k = 1 p K_\tau=[K(t_j,t_k)]_{j,k=1}^p K τ = [ K ( t j , t k ) ] j , k = 1 p . Then, for a random variable θ = ( p , τ , b ) \theta=(p,\tau,b) θ = ( p , τ , b ) we consider the parametric hierarchical model
X 1 , … , X n ∣ θ ∼ i . i . d . GP ( μ θ , K ) , p ∼ Π ( p ) , τ ∣ p ∼ Π ( τ ∣ p ) , b ∣ p ∼ Π ( b ∣ p ) , X_1,\ldots,X_n\mid\theta\mathrel{\overset{\mathrm{i.i.d.}}{\sim}}\operatorname{GP}(\mu_\theta,K),\quad p\sim\Pi(p),\quad\tau\mid p\sim\Pi(\tau\mid p),\quad b\mid p\sim\Pi(b\mid p), X 1 , … , X n ∣ θ ∼ i.i.d. GP ( μ θ , K ) , p ∼ Π ( p ) , τ ∣ p ∼ Π ( τ ∣ p ) , b ∣ p ∼ Π ( b ∣ p ) ,
where the implied independence between τ \tau τ and b b b (given p p p ) is just a convenience. We impose a discrete prior distribution Π ( p ) \Pi(p) Π ( p ) on the number of components, and a continuous distribution Π ( τ ∣ p ) \Pi(\tau\mid p) Π ( τ ∣ p ) for the time instants (e.g. uniform on T p \mathcal{T}_p T p ). The prior on the coefficient vector b b b has to be chosen carefully, since any continuous distribution will give zero mass to the null event { b = 0 } \{b=0\} { b = 0 } . To remedy this, we follow a spike-and-slab approach reminiscent of Bayesian variable selection in linear regression (e.g. [48 , 29 ] ), whereby a fixed mass is assigned to the null hypothesis and the remaining mass is distributed continuously on the alternative. Let 0 < π 0 < 1 0<\pi_0<1 0 < π 0 < 1 be the prior belief that the null hypothesis is true, and consider
Π ( b ∣ p ) = π 0 Π s p i k e ( b ) + ( 1 − π 0 ) Π s l a b ( b ) = π 0 δ 0 ( b ) + ( 1 − π 0 ) N p ( b ∣ 0 , η 2 I p ) , (4) \Pi(b\mid p)=\pi_0\Pi^{\mathrm{spike}}(b)+(1-\pi_0)\Pi^{\mathrm{slab}}(b)=\pi_0\delta_0(b)+(1-\pi_0)\mathcal{N}_p(b\mid0,\eta^2I_p), \tag*{(4)} Π ( b ∣ p ) = π 0 Π spike ( b ) + ( 1 − π 0 ) Π slab ( b ) = π 0 δ 0 ( b ) + ( 1 − π 0 ) N p ( b ∣ 0 , η 2 I p ) , (4)
where δ 0 \delta_0 δ 0 is a Dirac measure at 0 (the “spike”), I p I_p I p is the identity matrix of order p p p , and η 2 > 0 \eta^2 > 0 η 2 > 0 is a scalar hyperparameter. The mixture notation is a shorthand for a hierarchical representation with a latent indicator Z ∼ Bernoulli ( π 0 ) Z \sim\operatorname{Bernoulli}(\pi_0) Z ∼ Bernoulli ( π 0 ) and conditional distributions
b ∣ Z = 1 , p ∼ δ 0 and b ∣ Z = 0 , p ∼ N p ( 0 , η 2 I p ) . b \mid Z = 1, p \sim\delta_0 \quad\text{and} \quad b \mid Z = 0, p \sim\mathcal{N}_p(0,\eta^2 I_p). b ∣ Z = 1 , p ∼ δ 0 and b ∣ Z = 0 , p ∼ N p ( 0 , η 2 I p ) .
Unlike the priors for p p p and τ \tau τ , the choice of a normal distribution for the “slab” prior of b b b is not arbitrary; it will be used as a conjugacy device to simplify the posterior distribution later on. Note that this construction induces the priors Π ( H 0 ) = π 0 \Pi(H_0) = \pi_0 Π ( H 0 ) = π 0 and Π ( H 1 ) = 1 − π 0 \Pi(H_1) = 1 - \pi_0 Π ( H 1 ) = 1 − π 0 , since the null hypothesis is reinterpreted as H 0 : b = 0 H_0 : b = 0 H 0 : b = 0 .
Posterior Approximation
Bayes’ formula gives a posterior distribution Π n ( p , τ , b ∣ X 1 : n ) ∝ Π ( p , τ , b ) L ( X 1 : n ∣ p , τ , b ) \Pi_n(p,\tau,b \mid X_{1:n}) \propto\Pi(p,\tau,b)L(X_{1:n} \mid p,\tau,b) Π n ( p , τ , b ∣ X 1 : n ) ∝ Π ( p , τ , b ) L ( X 1 : n ∣ p , τ , b ) up to a multiplicative constant, which can be approximated through computational methods. However, sampling the high-dimensional parameter b ∈ R p b \in\mathbb{R}^p b ∈ R p is notoriously challenging, so we marginalize it analytically thanks to the prior structure in (4) . The marginal likelihood has the form
m ( X 1 : n ∣ p , τ ) = π 0 ∫ Π s p i k e ( b ) L ( X 1 : n ∣ p , τ , b ) d b + ( 1 − π 0 ) ∫ Π s l a b ( b ) L ( X 1 : n ∣ p , τ , b ) d b = π 0 m s p i k e ( X 1 : n ∣ p , τ ) + ( 1 − π 0 ) m s l a b ( X 1 : n ∣ p , τ ) . \begin{aligned}
m(X_{1:n} \mid p,\tau) &= \pi_0 \int\Pi^{\mathrm{spike}}(b)L(X_{1:n} \mid p,\tau,b)\,\mathrm{d}b + (1-\pi_0)\int\Pi^{\mathrm{slab}}(b)L(X_{1:n} \mid p,\tau,b)\,\mathrm{d}b \\
&= \pi_0m_{\mathrm{spike}}(X_{1:n} \mid p,\tau) + (1-\pi_0)m_{\mathrm{slab}}(X_{1:n} \mid p,\tau).
\end{aligned} m ( X 1 : n ∣ p , τ ) = π 0 ∫ Π spike ( b ) L ( X 1 : n ∣ p , τ , b ) d b + ( 1 − π 0 ) ∫ Π slab ( b ) L ( X 1 : n ∣ p , τ , b ) d b = π 0 m spike ( X 1 : n ∣ p , τ ) + ( 1 − π 0 ) m slab ( X 1 : n ∣ p , τ ) .
Since Π s p i k e ( b ) \Pi^{\mathrm{spike}}(b) Π spike ( b ) is a point mass at b = 0 b = 0 b = 0 , we have m s p i k e ( X 1 : n ∣ p , τ ) = e 0 = 1 m_{\mathrm{spike}}(X_{1:n} \mid p,\tau) = e^0 = 1 m spike ( X 1 : n ∣ p , τ ) = e 0 = 1 , according to (3) . In the slab part we get an exact integral, applying the formula for the moment generating function (at t = 1 t = 1 t = 1 ) of a quadratic form in Gaussian variables [46 Corollary 3.2a.1] :
m s l a b ( X 1 : n ∣ p , τ ) = ∫ N p ( b ∣ 0 , η 2 I p ) L ( X 1 : n ∣ p , τ , b ) d b = η − p ∣ Λ τ ∣ − 1 / 2 exp { 1 2 S n ( τ ) ′ Λ τ − 1 S n ( τ ) } , (5) \begin{aligned}
m_{\mathrm{slab}}(X_{1:n} \mid p,\tau) &= \int\mathcal{N}_p(b \mid0,\eta^2 I_p)L(X_{1:n} \mid p,\tau,b)\,\mathrm{d}b \\
&= \eta^{-p}|\Lambda_\tau|^{-1/2}\exp\left\{\frac{1}{2}S_n(\tau)'\Lambda_\tau^{-1}S_n(\tau)\right\}, \tag*{(5)}
\end{aligned} m slab ( X 1 : n ∣ p , τ ) = ∫ N p ( b ∣ 0 , η 2 I p ) L ( X 1 : n ∣ p , τ , b ) d b = η − p ∣ Λ τ ∣ − 1/2 exp { 2 1 S n ( τ ) ′ Λ τ − 1 S n ( τ ) } , (5)
where Λ τ = n K τ + η − 2 I p \Lambda_\tau= nK_\tau+ \eta^{-2}I_p Λ τ = n K τ + η − 2 I p . All in all, the marginal posterior expression becomes
Π n ( p , τ ∣ X 1 : n ) ∝ Π ( p ) Π ( τ ∣ p ) [ π 0 + ( 1 − π 0 ) m s l a b ( X 1 : n ∣ p , τ ) ] . (6) \Pi_n(p,\tau\mid X_{1:n}) \propto\Pi(p)\Pi(\tau\mid p)[\pi_0 + (1-\pi_0)m_{\mathrm{slab}}(X_{1:n} \mid p,\tau)]. \tag*{(6)} Π n ( p , τ ∣ X 1 : n ) ∝ Π ( p ) Π ( τ ∣ p ) [ π 0 + ( 1 − π 0 ) m slab ( X 1 : n ∣ p , τ )] . (6)
At this point we choose to use the RJMCMC algorithm to approximate the marginal posterior Π n ( p , τ ∣ X 1 : n ) \Pi_n(p,\tau\mid X_{1:n}) Π n ( p , τ ∣ X 1 : n ) . Unlike standard MCMC approaches, this method can traverse a variable-dimension parameter space by proposing the birth of a new component or the death of an existing one at each iteration. This yields a sequence of approximate posterior draws { ( p ( r ) , τ ( r ) ) : r = 1 , … , R } \{(p^{(r)},\tau^{(r)}) : r = 1,\ldots,R\} {( p ( r ) , τ ( r ) ) : r = 1 , … , R } , possibly of different dimensions. We can subsequently reapply Bayes’ formula conditional on ( p ( r ) , τ ( r ) ) (p^{(r)},\tau^{(r)}) ( p ( r ) , τ ( r ) ) to recover the posterior samples b ( r ) b^{(r)} b ( r ) , which in turn can be used to construct posterior samples μ ( r ) \mu^{(r)} μ ( r ) of the mean function via (1) . Details on these calculations and the specific implementation of RJMCMC are given in Appendix § 7 .
Decision Criteria
One of the main advantages of our Bayesian framework is that it naturally provides several posterior metrics to evaluate the evidence against the null hypothesis given the data. As we said before, the posterior probability of the null, Π n ( b = 0 ∣ X 1 : n ) \Pi_n(b = 0|X_{1:n}) Π n ( b = 0∣ X 1 : n ) , corresponds to E [ 1 { b = 0 } ∣ X 1 : n ] \mathbb{E}[1\{b = 0\}|X_{1:n}] E [ 1 { b = 0 } ∣ X 1 : n ] , where 1 { ⋅ } 1\{\cdot\} 1 { ⋅ } is the indicator function. We could naively compute the estimator R − 1 ∑ r 1 { b ( r ) = 0 } R^{-1}\sum_{r}1\{b^{(r)} = 0\} R − 1 ∑ r 1 { b ( r ) = 0 } with our posterior samples, which by the ergodic properties of the RJMCMC sampler would indeed converge almost surely to the target probability (under standard assumptions). However, this estimator introduces the Monte Carlo noise of actually sampling b ( r ) b^{(r)} b ( r ) , which is not desirable. Instead, we can consider the conditional posterior probability of the spike (computed through Bayes’ formula)
ψ n ( p , τ ) = Π n ( b = 0 ∣ p , τ , X 1 : n ) = π 0 m ( X 1 : n ∣ p , τ ) , (7) \psi_n(p,\tau) = \Pi_n(b = 0|p,\tau,X_{1:n}) = \frac{\pi_0}{m(X_{1:n}|p,\tau)}, \tag*{(7)} ψ n ( p , τ ) = Π n ( b = 0∣ p , τ , X 1 : n ) = m ( X 1 : n ∣ p , τ ) π 0 , (7)
and use the equivalence
E [ ψ n ( p , τ ) ∣ X 1 : n ] = ∑ p ∫ T p ψ n ( p , τ ) Π n ( p , τ ∣ X 1 : n ) d τ = Π n ( b = 0 ∣ X 1 : n ) \mathbb{E}[\psi_n(p,\tau)|X_{1:n}] = \sum_p \int_{\mathcal{T}_p} \psi_n(p,\tau)\Pi_n(p,\tau|X_{1:n})\,d\tau= \Pi_n(b = 0|X_{1:n}) E [ ψ n ( p , τ ) ∣ X 1 : n ] = p ∑ ∫ T p ψ n ( p , τ ) Π n ( p , τ ∣ X 1 : n ) d τ = Π n ( b = 0∣ X 1 : n )
to obtain a more efficient estimator of the posterior probability of H 0 H_0 H 0 . Indeed, by the law of total variance we have:
Var ( ψ n ( p , τ ) ∣ X 1 : n ) = Var ( E [ 1 { b = 0 } ∣ p , τ , X 1 : n ] ∣ X 1 : n ) ≤ Var ( 1 { b = 0 } ∣ X 1 : n ) . \operatorname{Var}(\psi_n(p,\tau)|X_{1:n}) = \operatorname{Var}(\mathbb{E}[1\{b = 0\}|p,\tau,X_{1:n}]|X_{1:n}) \le\operatorname{Var}(1\{b = 0\}|X_{1:n}). Var ( ψ n ( p , τ ) ∣ X 1 : n ) = Var ( E [ 1 { b = 0 } ∣ p , τ , X 1 : n ] ∣ X 1 : n ) ≤ Var ( 1 { b = 0 } ∣ X 1 : n ) .
Hence, conditioning on ( p , τ ) (p,\tau) ( p , τ ) and averaging the posterior spike probabilities ψ n ( p ( r ) , τ ( r ) ) \psi_n(p^{(r)},\tau^{(r)}) ψ n ( p ( r ) , τ ( r ) ) instead of the raw indicators 1 { b ( r ) = 0 } 1\{b^{(r)} = 0\} 1 { b ( r ) = 0 } yields the improved estimator1
π ^ n u l l = 1 R ∑ r = 1 R ψ n ( p ( r ) , τ ( r ) ) . \widehat{\pi}_{\mathrm{null}} = \frac{1}{R}\sum_{r=1}^{R}\psi_n(p^{(r)},\tau^{(r)}). π null = R 1 r = 1 ∑ R ψ n ( p ( r ) , τ ( r ) ) .
Under the 0–1 loss function, we would reject the null hypothesis if π ^ n u l l ≤ 1 / 2 \widehat{\pi}_{\mathrm{null}} \le1/2 π null ≤ 1/2 and accept it otherwise, but practitioners can fix any arbitrary threshold on a case-by-case basis.
Another quantity of interest to assess the evidence against the null hypothesis is the Bayes factor, which is defined as
B F 10 ( X 1 : n ) = L ( X 1 : n ∣ H 1 ) L ( X 1 : n ∣ H 0 ) = 1 − Π n ( H 0 ∣ X 1 : n ) Π n ( H 0 ∣ X 1 : n ) ⋅ π 0 1 − π 0 \mathrm{BF}_{10}(X_{1:n}) = \frac{L(X_{1:n}|H_1)}{L(X_{1:n}|H_0)} = \frac{1-\Pi_n(H_0|X_{1:n})}{\Pi_n(H_0|X_{1:n})}\cdot\frac{\pi_0}{1-\pi_0} BF 10 ( X 1 : n ) = L ( X 1 : n ∣ H 0 ) L ( X 1 : n ∣ H 1 ) = Π n ( H 0 ∣ X 1 : n ) 1 − Π n ( H 0 ∣ X 1 : n ) ⋅ 1 − π 0 π 0
and represents the evidence in favor of H 1 H_1 H 1 over H 0 H_0 H 0 as supported by the data. For example, if π 0 = 1 − π 0 = 1 / 2 \pi_0 = 1-\pi_0 = 1/2 π 0 = 1 − π 0 = 1/2 , then Π n ( H 0 ∣ X 1 : n ) = 1 / 2 \Pi_n(H_0|X_{1:n}) = 1/2 Π n ( H 0 ∣ X 1 : n ) = 1/2 corresponds to B F 10 ( X 1 : n ) = 1 \mathrm{BF}_{10}(X_{1:n}) = 1 BF 10 ( X 1 : n ) = 1 . Note that in our model L ( X 1 : n ∣ H 0 ) L(X_{1:n}|H_0) L ( X 1 : n ∣ H 0 ) is actually equal to 1 by construction, since we take P 0 P_0 P 0 as the reference measure. In practice, we report an estimated Bayes factor
B F ^ 10 = 1 − π ^ n u l l π ^ n u l l ⋅ π 0 1 − π 0 . \widehat{\mathrm{BF}}_{10} = \frac{1-\widehat{\pi}_{\mathrm{null}}}{\widehat{\pi}_{\mathrm{null}}}\cdot\frac{\pi_0}{1-\pi_0}. BF 10 = π null 1 − π null ⋅ 1 − π 0 π 0 .
and use Jeffreys’ scale (see Table 1 ) to weigh the evidence against H 0 H_0 H 0 . Observe that the Bayes factor (a likelihood ratio) is actually independent of the prior belief π 0 \pi_0 π 0 , so it acts as a somewhat more objective measure to compare evidence against H 0 H_0 H 0 across different models.
Table 1. Jeffreys’ scale for the Bayes factor, adapted by Kass and Raftery [33 ] .
Lastly, we can report the posterior probability of the so-called region of practical equivalence (ROPE), defined for a small ε > 0 \varepsilon> 0 ε > 0 as
Π n ( sup s ∣ μ ( s ) ∣ < ε ∣ X 1 : n ) . \Pi_n\left(\sup_{s} \lvert\mu(s)\rvert< \varepsilon\mid X_{1:n}\right). Π n ( s sup ∣ μ ( s )∣ < ε ∣ X 1 : n ) .
This “practical null” probability is sometimes used to evaluate H 0 H_0 H 0 when an exact zero is not meaningful, and is readily available in our Bayesian setting without changing the overall approach (i.e. without considering a precise hypothesis H 0 ε : sup s ∣ μ ( s ) ∣ < ε H_0^\varepsilon: \sup_s \lvert\mu(s)\rvert< \varepsilon H 0 ε : sup s ∣ μ ( s )∣ < ε from the start). The easiest way to approximate the ROPE probability on the observation grid S \mathcal{S} S is through the Monte Carlo estimator
π ^ R O P E ( ε ) = 1 R ∑ r = 1 R 1 { max s ∈ S ∣ μ ( r ) ( s ) ∣ < ε } . \widehat{\pi}_{\mathrm{ROPE}}(\varepsilon) = \frac{1}{R}\sum_{r=1}^{R} \mathbb{1}\left\{\max_{s\in\mathcal{S}}\lvert\mu^{(r)}(s)\rvert< \varepsilon\right\}. π ROPE ( ε ) = R 1 r = 1 ∑ R 1 { s ∈ S max ∣ μ ( r ) ( s )∣ < ε } .
Posterior Summaries and Uncertainty Quantification
An additional benefit of the Bayesian framework is that it facilitates posterior inference on the mean function as a by-product of the testing procedure. For example, we can estimate the posterior mean function μ P M ( ⋅ ) = E [ μ ( ⋅ ) ∣ X ] \mu^{\mathrm{PM}}(\cdot) = \mathbb{E}[\mu(\cdot)\mid X] μ PM ( ⋅ ) = E [ μ ( ⋅ ) ∣ X ] using the conditional expectation strategy again, which is typically much less noisy than averaging posterior draws μ ( r ) \mu^{(r)} μ ( r ) directly. Indeed, for a fixed s ∈ [ 0 , 1 ] s \in[0,1] s ∈ [ 0 , 1 ] the law of total expectation gives E [ μ ( s ) ∣ X ] = E [ E [ μ ( s ) ∣ p , τ , X ] ∣ X ] \mathbb{E}[\mu(s)\mid X] = \mathbb{E}[\mathbb{E}[\mu(s)\mid p,\tau,X]\mid X] E [ μ ( s ) ∣ X ] = E [ E [ μ ( s ) ∣ p , τ , X ] ∣ X ] , and the same variance reduction argument as before applies. In the i.i.d. case, the inner posterior expectation admits the closed-form expression
E [ μ ( s ) ∣ p , τ , X 1 : n ] = ( 1 − ψ n ( p , τ ) ) K ( τ , s ) ′ Λ τ − 1 S n ( τ ) . \mathbb{E}[\mu(s)\mid p,\tau,X_{1:n}] = (1-\psi_n(p,\tau))K(\tau,s)^{\prime}\Lambda_{\tau}^{-1}S_n(\tau). E [ μ ( s ) ∣ p , τ , X 1 : n ] = ( 1 − ψ n ( p , τ )) K ( τ , s ) ′ Λ τ − 1 S n ( τ ) .
where K ( τ , s ) K(\tau,s) K ( τ , s ) denotes the p × 1 p\times1 p × 1 vector with entries K ( t j , s ) K(t_j,s) K ( t j , s ) , and Λ τ − 1 S n ( τ ) \Lambda_{\tau}^{-1}S_n(\tau) Λ τ − 1 S n ( τ ) is the posterior expectation of the coefficients under the slab (see Appendix § 7 ). Consequently, a Monte Carlo estimator of the posterior mean function is given by
μ ^ n P M ( ⋅ ) = E ^ [ μ ( ⋅ ) ∣ X 1 : n ] = 1 R ∑ r = 1 R ( 1 − ψ n ( p ( r ) , τ ( r ) ) ) K ( τ ( r ) , ⋅ ) ′ Λ τ ( r ) − 1 S n ( τ ( r ) ) , \widehat{\mu}_n^{\mathrm{PM}}(\cdot) = \widehat{\mathbb{E}}[\mu(\cdot)\mid X_{1:n}] = \frac{1}{R}\sum_{r=1}^{R}(1-\psi_n(p^{(r)},\tau^{(r)}))K(\tau^{(r)},\cdot)^{\prime}\Lambda_{\tau^{(r)}}^{-1}S_n(\tau^{(r)}), μ n PM ( ⋅ ) = E [ μ ( ⋅ ) ∣ X 1 : n ] = R 1 r = 1 ∑ R ( 1 − ψ n ( p ( r ) , τ ( r ) )) K ( τ ( r ) , ⋅ ) ′ Λ τ ( r ) − 1 S n ( τ ( r ) ) ,
which is then evaluated on the grid S \mathcal{S} S . Note that this can be seen as a regularized estimator for μ \mu μ in which a certain weight π 0 \pi_0 π 0 was placed on it being the zero function.
Along with the posterior expectation of μ \mu μ , it is common to report credible bands around it to quantify the uncertainty in the posterior estimation. In particular, for any α ∈ ( 0 , 1 ) \alpha\in(0,1) α ∈ ( 0 , 1 ) we compute simultaneous 1 − α 1-\alpha 1 − α credible bands, that is, bands that contain the entire function μ \mu μ with posterior probability 1 − α 1-\alpha 1 − α . The usual approach for constructing such bands is the maximum deviation method described by Crainiceanu et al. [13 ] . The main idea is to standardize the deviations from the posterior mean by the pointwise posterior standard deviation σ ( s ) = Var ( μ ( s ) ∣ X 1 : n ) \sigma(s) = \sqrt{\operatorname{Var}(\mu(s)\mid X_{1:n})} σ ( s ) = Var ( μ ( s ) ∣ X 1 : n ) , to obtain bands that adapt to the local uncertainty. In particular, we aim to find a single critical value q 1 − α q_{1-\alpha} q 1 − α satisfying
Π n ( sup s ∈ [ 0 , 1 ] ∣ μ ( s ) − μ P M ( s ) ∣ σ ( s ) ≤ q 1 − α | X 1 : n ) = 1 − α , \Pi_n\left(\sup_{s\in[0,1]}\frac{\lvert\mu(s)-\mu^{\mathrm{PM}}(s)\rvert}{\sigma(s)}\leq q_{1-\alpha}\middle|X_{1:n}\right)=1-\alpha, Π n ( s ∈ [ 0 , 1 ] sup σ ( s ) ∣ μ ( s ) − μ PM ( s )∣ ≤ q 1 − α X 1 : n ) = 1 − α ,
and then form symmetrical bands { μ P M ( s ) ± q 1 − α σ ( s ) : s ∈ [ 0 , 1 ] } \{\mu^{\mathrm{PM}}(s)\pm q_{1-\alpha}\sigma(s):s\in[0,1]\} { μ PM ( s ) ± q 1 − α σ ( s ) : s ∈ [ 0 , 1 ]} . In practice, this procedure is carried out on the discretized grid. First, compute the pointwise posterior standard deviation at each grid point s ∈ S s\in\mathcal{S} s ∈ S as
σ ^ ( s ) = Var ( { μ ( r ) ( s ) } r = 1 R ) . \widehat{\sigma}(s)=\sqrt{\operatorname{Var}\left(\{\mu^{(r)}(s)\}_{r=1}^{R}\right)}. σ ( s ) = Var ( { μ ( r ) ( s ) } r = 1 R ) .
Then, for each draw compute the standardized supremum deviation
D ( r ) = max s ∈ S ∣ μ ( r ) ( s ) − μ ^ n P M ( s ) ∣ σ ^ ( s ) . D^{(r)}=\max_{s\in\mathcal{S}}\frac{\left\lvert\mu^{(r)}(s)-\widehat{\mu}^{\mathrm{PM}}_n(s)\right\rvert}{\widehat{\sigma}(s)}. D ( r ) = s ∈ S max σ ( s ) μ ( r ) ( s ) − μ n PM ( s ) .
Lastly, find the empirical 1 − α 1-\alpha 1 − α quantile q ^ 1 − α \widehat{q}_{1-\alpha} q 1 − α of { D ( r ) } r = 1 R \{D^{(r)}\}_{r=1}^{R} { D ( r ) } r = 1 R , and construct the credible bands { μ ^ n P M ( s ) ± q ^ 1 − α σ ^ ( s ) : s ∈ S } \{\widehat{\mu}^{\mathrm{PM}}_n(s)\pm\widehat{q}_{1-\alpha}\widehat{\sigma}(s):s\in\mathcal{S}\} { μ n PM ( s ) ± q 1 − α σ ( s ) : s ∈ S } . Depending on whether the zero function lies entirely within the band, we have another metric to reject H 0 H_0 H 0 (at probability level 1 − α 1-\alpha 1 − α ).
Estimation of the Covariance Function
So far we have treated K K K as known, but in practice we rarely have access to the complete covariance function. The FDA literature offers a variety of estimation techniques depending on the application and available data, such as maximum likelihood, functional principal component analysis (FPCA), and smooth interpolation methods (e.g. Li and Hsing [40 ] ; Xiao et al. [62 ] ; Wong and Zhang [61 ] ; Mbaka et al. [47 ] ). Parametric approaches—both frequentist and Bayesian—are also widely used, but they often require extra assumptions that lead to more complex models. We advocate for a simpler plug-in strategy in which an estimated covariance is computed from the data, and then used in our model as if it were the true covariance. The performance of the plug-in test for finite sample sizes will depend on how well the estimated covariance approximates K K K , but as we will see in § 3.2 , the asymptotic properties of the test are unaffected if the estimator itself is uniformly consistent. Denote the sample mean by X ‾ n ( ⋅ ) = n − 1 ∑ i X i ( ⋅ ) \overline{X}_n(\cdot)=n^{-1}\sum_i X_i(\cdot) X n ( ⋅ ) = n − 1 ∑ i X i ( ⋅ ) and consider the standard empirical covariance estimator
C ^ n ( t , s ) = 1 n − 1 ∑ i = 1 n ( X i ( t ) − X ‾ n ( t ) ) ( X i ( s ) − X ‾ n ( s ) ) . \widehat{C}_n(t,s)=\frac{1}{n-1}\sum_{i=1}^{n}(X_i(t)-\overline{X}_n(t))(X_i(s)-\overline{X}_n(s)). C n ( t , s ) = n − 1 1 i = 1 ∑ n ( X i ( t ) − X n ( t )) ( X i ( s ) − X n ( s )) .
From a computational perspective we only need to consider its discretized counterpart C ^ n = [ C ^ n ( s g , s h ) ] g , h = 1 G \widehat{\mathbf{C}}_n=[\widehat{C}_n(s_g,s_h)]_{g,h=1}^{G} C n = [ C n ( s g , s h ) ] g , h = 1 G , which approximates the discretized covariance K = [ K ( s g , s h ) ] g , h = 1 G \mathbf{K}=[K(s_g,s_h)]_{g,h=1}^{G} K = [ K ( s g , s h ) ] g , h = 1 G . However, in functional settings the sample size is typically small relative to the number of grid points, so the empirical covariance can be highly rank-deficient. A common regularization technique consists on shrinking towards a well-conditioned target to lift the near-zero eigenvalues, improving the quality and stability of the estimator. The Oracle Approximating Shrinkage (OAS) estimator (Chen et al. [10 ] ), based on an earlier proposal by Ledoit and Wolf [39 ] and improved for the Gaussian case, is a popular choice for this purpose. Its closed-form expression on the grid is
K ^ n O A S = ( 1 − ρ ^ n ) C ^ n + ρ ^ n Tr ( C ^ n ) G I G , \widehat{\mathbf{K}}_{n}^{\mathrm{OAS}} = (1-\widehat{\rho}_{n})\widehat{\mathbf{C}}_{n}+\widehat{\rho}_{n}\frac{\operatorname{Tr}(\widehat{\mathbf{C}}_{n})}{G}I_{G}, K n OAS = ( 1 − ρ n ) C n + ρ n G Tr ( C n ) I G ,
where
ρ ^ n = min { 1 , ( 1 − 2 / G ) Tr ( C ^ n 2 ) + Tr 2 ( C ^ n ) ( n + 1 − 2 / G ) [ Tr ( C ^ n 2 ) − Tr 2 ( C ^ n ) / G ] } . (8) \widehat{\rho}_{n}=\min\left\{1,\frac{(1-2/G)\operatorname{Tr}(\widehat{\mathbf{C}}_{n}^{2})+\operatorname{Tr}^{2}(\widehat{\mathbf{C}}_{n})}{(n+1-2/G)\left[\operatorname{Tr}(\widehat{\mathbf{C}}_{n}^{2})-\operatorname{Tr}^{2}(\widehat{\mathbf{C}}_{n})/G\right]}\right\}. \tag*{(8)} ρ n = min ⎩ ⎨ ⎧ 1 , ( n + 1 − 2/ G ) [ Tr ( C n 2 ) − Tr 2 ( C n ) / G ] ( 1 − 2/ G ) Tr ( C n 2 ) + Tr 2 ( C n ) ⎭ ⎬ ⎫ . (8)
A convenient consequence of this formulation is that the resulting covariance matrix is strictly positive definite (except in pathological cases). Moreover, it can be shown that as the sample size grows the OAS estimator increasingly resembles the empirical covariance estimator C ^ n \widehat{\mathbf{C}}_{n} C n , which is the expected behavior since there is less and less need for regularization.
Asymptotic Theory
To assess the frequentist behavior of the proposed Bayesian test, we study posterior consistency and posterior contraction rates. Posterior consistency means that, as the sample size grows, the posterior probability assigned to the true hypothesis converges to one (under the true data generating distribution), so the Bayesian procedure is asymptotically correct. More generally, a posterior contraction rate quantifies how fast the posterior mass concentrates around the true hypothesis as n → ∞ n \to\infty n → ∞ .
To evaluate contraction rates we will use the standard concept of stochastic boundedness (van der Vaart [59 ] ): given a sequence of nonnegative random variables Y n Y_n Y n , whose distribution is determined by P \mathbb{P} P , and a sequence of positive numbers a n a_n a n , we write Y n = O P ( a n ) Y_n=O_{\mathbb{P}}(a_n) Y n = O P ( a n ) if for any ϵ > 0 \epsilon>0 ϵ > 0 there exist N , M > 0 N,M>0 N , M > 0 such that P ( Y n / a n > M ) < ϵ \mathbb{P}(Y_n/a_n>M)<\epsilon P ( Y n / a n > M ) < ϵ for all n > N n>N n > N . In this case, if a n → 0 a_n\to0 a n → 0 we say that a n a_n a n is a contraction rate for Y n Y_n Y n , or equivalently, that Y n Y_n Y n decays at rate a n a_n a n (in probability).
We already established that the sample paths of the process X X X are supposed to be continuous, but we state this fact as an explicit assumption to emphasize its importance in the theoretical guarantees.
(A1) The sample paths t ↦ X ( t ) t\mapsto X(t) t ↦ X ( t ) are continuous almost surely.
As an abuse of notation, we still write P 0 \mathbb{P}_0 P 0 and P μ \mathbb{P}_{\mu} P μ for the product measures P 0 ( n ) \mathbb{P}_0^{(n)} P 0 ( n ) and P μ ( n ) \mathbb{P}_{\mu}^{(n)} P μ ( n ) of ( X 1 , X 2 , … , X n ) (X_1,X_2,\ldots,X_n) ( X 1 , X 2 , … , X n ) , respectively, when the dependence on the sample size n n n is clear from context. Moreover, we let P 0 ∞ \mathbb{P}_0^{\infty} P 0 ∞ denote the distribution of ( X 1 , X 2 , … ) (X_1,X_2,\ldots) ( X 1 , X 2 , … ) under H 0 H_0 H 0 . The proofs of the results in this section are deferred to Appendix B.
Consistency and Contraction Rates for Known Covariance
We first focus on the case where H 0 H_0 H 0 is true, that is, X 1 , … , X n ∼ GP ( 0 , K ) X_1,\ldots,X_n \sim\operatorname{GP}(0,K) X 1 , … , X n ∼ GP ( 0 , K ) i.i.d. with distribution P 0 P_0 P 0 . As it is often the case in Bayesian tests with a point-null hypothesis, posterior consistency holds as long as Π ( H 0 ) > 0 \Pi(H_0)>0 Π ( H 0 ) > 0 , through a direct application of Doob’s theorem [16 , 21 Theorem 10.24] .
Theorem 1. Under H 0 H_0 H 0 , lim n → ∞ Π n ( H 1 ∣ X 1 : n ) = 0 \lim_{n\to\infty}\Pi_n(H_1\mid X_{1:n})=0 lim n → ∞ Π n ( H 1 ∣ X 1 : n ) = 0 a.s. [ P 0 ∞ ] [P_0^\infty] [ P 0 ∞ ] .
To study posterior contraction rates, we impose additional assumptions on the prior distributions.
(A2) The prior measure on the time instants, Π τ ( ⋅ ∣ p ) \Pi_\tau(\cdot\mid p) Π τ ( ⋅ ∣ p ) , is supported on a compact subset C p ⊂ T p C_p\subset T_p C p ⊂ T p , that is, Π τ ( C p ∣ p ) = 1 \Pi_\tau(C_p\mid p)=1 Π τ ( C p ∣ p ) = 1 for all p p p such that Π ( p ) > 0 \Pi(p)>0 Π ( p ) > 0 .
(A3) The prior Π ( p ) \Pi(p) Π ( p ) has finite support, i.e., Π ( p ) = 0 \Pi(p)=0 Π ( p ) = 0 for all p > P max p>P_{\max} p > P m a x .
Note that (A2) is verified, for example, by enforcing a uniform minimum separation on the time points in τ \tau τ (which already happens in practice on the finite grid S \mathcal{S} S ). Indeed, for a fixed δ > 0 \delta>0 δ > 0 one can consider the compact set
C p ( δ ) = { ( t 1 , … , t p ) ∈ [ 0 , 1 ] p : t 1 ≥ δ , t p ≤ 1 − δ , t j + 1 − t j ≥ δ for j = 1 , … , p − 1 } . C_p(\delta)=\{(t_1,\ldots,t_p)\in[0,1]^p:t_1\ge\delta,\ t_p\le1-\delta,\ t_{j+1}-t_j\ge\delta\text{ for }j=1,\ldots,p-1\}. C p ( δ ) = {( t 1 , … , t p ) ∈ [ 0 , 1 ] p : t 1 ≥ δ , t p ≤ 1 − δ , t j + 1 − t j ≥ δ for j = 1 , … , p − 1 } .
On the other hand, (A3) is effectively a truncation on the model dimension, but it is not as restrictive as it may seem. Firstly, it is a standard assumption in the literature, and secondly, our model is designed for simplicity and parsimony, so we in fact encourage fewer components. In any event, the unknown value of p p p can still vary over a set as large as needed (e.g. we can take P max = ∣ S ∣ P_{\max}=|\mathcal{S}| P m a x = ∣ S ∣ ). With these assumptions in mind, we can show that under H 0 H_0 H 0 the posterior probability of the alternative hypothesis decays polynomially in the sample size. Let p min = min { p ∈ N : Π ( p ) > 0 } p_{\min}=\min\{p\in\mathbb{N}:\Pi(p)>0\} p m i n = min { p ∈ N : Π ( p ) > 0 } .
Theorem 2. Suppose (A1)–(A3) hold. Then, Π n ( H 1 ∣ X 1 : n ) = O P 0 ( n − p min / 2 ) \Pi_n(H_1\mid X_{1:n})=O_{P_0}(n^{-p_{\min}/2}) Π n ( H 1 ∣ X 1 : n ) = O P 0 ( n − p m i n /2 ) under H 0 H_0 H 0 .
Remark 3. If p min = 1 p_{\min}=1 p m i n = 1 we recover the standard parametric rate n − 1 / 2 n^{-1/2} n − 1/2 . Even though the asymptotic rate O P 0 ( n − p min / 2 ) O_{P_0}(n^{-p_{\min}/2}) O P 0 ( n − p m i n /2 ) would suggest that it is better to ignore low values of p p p in the prior to improve consistency speed, finite-sample performance can be hurt by considering many components, since they introduce increasingly high collinearity. Moreover, removing low-dimensional alternatives makes the test more conservative and reduces interpretability.
We now turn to the case where H 1 H_1 H 1 is true. Suppose that the model is well-specified and denote the true mean function by μ ∗ ∈ H ( K ) ∖ { 0 } \mu_*\in\mathcal{H}(K)\setminus\{0\} μ ∗ ∈ H ( K ) ∖ { 0 } , so that X 1 , … , X n ∼ GP ( μ ∗ , K ) X_1,\ldots,X_n\sim\operatorname{GP}(\mu_*,K) X 1 , … , X n ∼ GP ( μ ∗ , K ) i.i.d. with distribution P μ ∗ P_{\mu_*} P μ ∗ (note that μ ∗ ∈ H ( K ) ∖ H 0 ( K ) \mu_*\in\mathcal{H}(K)\setminus\mathcal{H}_0(K) μ ∗ ∈ H ( K ) ∖ H 0 ( K ) is allowed). In this situation we need to make sure that the prior places positive mass on the true mean, so the support cannot be restricted.
(A4) The prior distribution Π \Pi Π charges open sets, i.e., Π ( p ) > 0 \Pi(p)>0 Π ( p ) > 0 for all p ∈ N p\in\mathbb{N} p ∈ N and Π τ , b s l a b ( U ∣ p ) > 0 \Pi_{\tau,b}^{\mathrm{slab}}(U\mid p)>0 Π τ , b slab ( U ∣ p ) > 0 for all open sets U ⊆ T p × R p U\subseteq T_p\times\mathbb{R}^p U ⊆ T p × R p , where Π τ , b s l a b ( ⋅ ∣ p ) \Pi_{\tau,b}^{\mathrm{slab}}(\cdot\mid p) Π τ , b slab ( ⋅ ∣ p ) is the slab part of the joint prior measure on ( τ , b ) (\tau,b) ( τ , b ) .
This mild condition is already sufficient to derive exponential contraction rates (which immediately guarantees posterior consistency). The proof relies on the fact that H 0 ( K ) \mathcal{H}_0(K) H 0 ( K ) is dense in H ( K ) \mathcal{H}(K) H ( K ) , so we can always find an approximation μ θ ∈ H 0 ( K ) \mu_\theta\in\mathcal{H}_0(K) μ θ ∈ H 0 ( K ) as close as desired to μ ∗ \mu_* μ ∗ in the RKHS norm.
Theorem 4 Suppose (A1) and (A4) hold. Then, Π n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − n γ ) \Pi_n(H_0 \mid X_{1:n}) = O_{P_{\mu_*}}(e^{-n\gamma}) Π n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − nγ ) under H 1 H_1 H 1 , for any 0 < γ < 1 2 ∥ μ ∗ ∥ K 2 0 < \gamma< \frac{1}{2}\lVert\mu_*\rVert_K^2 0 < γ < 2 1 ∥ μ ∗ ∥ K 2 .
Remark 5 The upper bound on γ \gamma γ is not arbitrary; we will show in § 3.3 that it is in fact an information-theoretic limit. We also note that, as expected, the rate will be faster when it is easier to distinguish μ ∗ \mu_* μ ∗ from the zero function, that is, the larger ∥ μ ∗ ∥ K \lVert\mu_*\rVert_K ∥ μ ∗ ∥ K is.
It is worth mentioning that (A4) is a bit more restrictive than needed, and it cannot hold simultaneously with the assumptions of Theorem 2. Looking carefully at the proof of Theorem 4 (see Appendix B), one notices that the approximated mean function μ θ \mu_\theta μ θ is only required to satisfy the condition ∥ μ ∗ − μ θ ∥ K 2 < ∥ μ ∗ ∥ K 2 \lVert\mu_*-\mu_\theta\rVert_K^2 < \lVert\mu_*\rVert_K^2 ∥ μ ∗ − μ θ ∥ K 2 < ∥ μ ∗ ∥ K 2 . To make the result compatible with the practical assumptions (A2) and (A3), we could replace (A4) by the following condition.
(A4’) There exists θ 0 = ( p 0 , τ 0 , b 0 ) \theta_0 = (p_0,\tau_0,b_0) θ 0 = ( p 0 , τ 0 , b 0 ) such that p 0 ≤ P max p_0 \le P_{\max} p 0 ≤ P m a x , τ 0 ∈ C p 0 \tau_0 \in\mathcal{C}_{p_0} τ 0 ∈ C p 0 , b 0 ∈ R p 0 ∖ { 0 } b_0 \in\mathbb{R}^{p_0}\setminus\{0\} b 0 ∈ R p 0 ∖ { 0 } and ∥ μ ∗ − μ θ 0 ∥ K 2 < ∥ μ ∗ ∥ K 2 \lVert\mu_*-\mu_{\theta_0}\rVert_K^2 < \lVert\mu_*\rVert_K^2 ∥ μ ∗ − μ θ 0 ∥ K 2 < ∥ μ ∗ ∥ K 2 . Moreover, for each p ≤ P max p \le P_{\max} p ≤ P m a x we have Π ( p ) > 0 \Pi(p) > 0 Π ( p ) > 0 and Π τ , b s l a b ( ⋅ ∣ p ) \Pi^{\mathrm{slab}}_{\tau,b}(\cdot\mid p) Π τ , b slab ( ⋅ ∣ p ) has full support on C p × R p \mathcal{C}_p \times\mathbb{R}^p C p × R p .
The full support condition is trivially satisfied with a standard choice of priors. As for the approximation constraint, we claim that in practice it reduces to a very minor requirement on the grid S S S . Fix p 0 = 1 p_0 = 1 p 0 = 1 , consider any single time point s s s with τ 0 = ( s ) ∈ C 1 \tau_0 = (s) \in\mathcal{C}_1 τ 0 = ( s ) ∈ C 1 , and set b 0 = ( μ ∗ ( s ) / K ( s , s ) ) b_0 = (\mu_*(s)/K(s,s)) b 0 = ( μ ∗ ( s ) / K ( s , s )) , which is well-defined because K K K is strictly positive definite. Then, by expanding the RKHS norm and using the reproducing property, we get
∥ μ ∗ − μ θ 0 ∥ K 2 = ∥ μ ∗ ∥ K 2 + ∥ μ θ 0 ∥ K 2 − 2 ⟨ μ ∗ , μ θ 0 ⟩ K = ∥ μ ∗ ∥ K 2 − μ ∗ ( s ) 2 K ( s , s ) . \lVert\mu_*-\mu_{\theta_0}\rVert_K^2 = \lVert\mu_*\rVert_K^2 + \lVert\mu_{\theta_0}\rVert_K^2 - 2\langle\mu_*,\mu_{\theta_0}\rangle_K = \lVert\mu_*\rVert_K^2 - \frac{\mu_*(s)^2}{K(s,s)}. ∥ μ ∗ − μ θ 0 ∥ K 2 = ∥ μ ∗ ∥ K 2 + ∥ μ θ 0 ∥ K 2 − 2 ⟨ μ ∗ , μ θ 0 ⟩ K = ∥ μ ∗ ∥ K 2 − K ( s , s ) μ ∗ ( s ) 2 .
which is smaller than ∥ μ ∗ ∥ K 2 \lVert\mu_*\rVert_K^2 ∥ μ ∗ ∥ K 2 as long as μ ∗ ( s ) ≠ 0 \mu_*(s) \ne0 μ ∗ ( s ) = 0 . Thus, (A4’) holds whenever there exists at least one point in C 1 \mathcal{C}_1 C 1 (which is effectively equal to S S S ) where μ ∗ \mu_* μ ∗ does not vanish.
We can state a variant of Theorem 4 under this alternative assumption, in which the exponential rate now includes an additional approximation slack.
Theorem 6 Suppose (A1)–(A3) and (A4’) hold. Then, Π n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − n γ ) \Pi_n(H_0\mid X_{1:n}) = O_{P_{\mu_*}}(e^{-n\gamma}) Π n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − nγ ) under H 1 H_1 H 1 , for any 0 < γ < 1 2 ( ∥ μ ∗ ∥ K 2 − ∥ μ ∗ − μ θ 0 ∥ K 2 ) 0 < \gamma< \frac{1}{2}(\lVert\mu_*\rVert_K^2-\lVert\mu_*-\mu_{\theta_0}\rVert_K^2) 0 < γ < 2 1 (∥ μ ∗ ∥ K 2 − ∥ μ ∗ − μ θ 0 ∥ K 2 ) .
Remark 7 By considering (A4’) instead of (A4) we gain a simpler condition that does not conflict with the assumptions of Theorem 2, but the price we pay is a slower contraction rate under H 1 H_1 H 1 (unless μ ∗ ∈ H 0 ( K ) \mu_* \in\mathcal{H}_0(K) μ ∗ ∈ H 0 ( K ) ). Moreover, even though (A4’) can be satisfied with just p 0 = 1 p_0 = 1 p 0 = 1 , the rate improves with the quality of the approximation (i.e. when ∥ μ ∗ − μ θ 0 ∥ K 2 \lVert\mu_*-\mu_{\theta_0}\rVert_K^2 ∥ μ ∗ − μ θ 0 ∥ K 2 is small), so we can expect much faster rates if the condition holds for bigger values of p 0 p_0 p 0 .
Consistency and Contraction Rates for Plug-in Covariance
We extend the results of § 3.1 to the case in which the true covariance function K ( t , s ) K(t,s) K ( t , s ) is unknown and replaced by a symmetric plug-in estimator K ^ n ( t , s ) \widehat{K}_n(t,s) K n ( t , s ) , which need not be strictly positive definite. For any τ ∈ T p \tau\in\mathcal{T}_p τ ∈ T p , let K ^ n , τ = [ K ^ n ( t j , t k ) ] j , k = 1 p \widehat{K}_{n,\tau} = [\widehat{K}_n(t_j,t_k)]_{j,k=1}^p K n , τ = [ K n ( t j , t k ) ] j , k = 1 p be the plug-in analog of the matrix K τ K_\tau K τ defined in (3) . We will see that as long as we have uniform consistency of K ^ n , τ \widehat{K}_{n,\tau} K n , τ to K τ K_\tau K τ , the approximation effect is negligible and the posterior contraction rates stay the same. Therefore, we impose the following condition.
(A5) For every p p p with Π ( p ) > 0 \Pi(p)>0 Π ( p ) > 0 and any compact set C p ⊂ T p C_p \subset\mathcal{T}_p C p ⊂ T p , it holds that
sup τ ∈ C p ∥ K ^ n , τ − K τ ∥ → P 0. \sup_{\tau\in C_p} \lVert\widehat{K}_{n,\tau} - K_\tau\rVert\xrightarrow{\mathbb{P}} 0. τ ∈ C p sup ∥ K n , τ − K τ ∥ P 0.
It can be shown that both the empirical covariance estimator C ^ n \widehat{C}_n C n and the OAS estimator described in § 2.5 satisfy the stronger condition of almost sure uniform convergence. Consider for each τ ∈ T p \tau\in\mathcal{T}_p τ ∈ T p the discretized matrices
C ^ n , τ = [ C ^ n ( t j , t k ) ] j , k = 1 p and K ^ n , τ O A S = ( 1 − ρ ^ n , τ ) C ^ n , τ + ρ ^ n , τ Tr ( C ^ n , τ ) p I p , \widehat{C}_{n,\tau} = [\widehat{C}_n(t_j,t_k)]_{j,k=1}^p
\quad\text{and}\quad
\widehat{K}^{\mathrm{OAS}}_{n,\tau} = (1-\widehat{\rho}_{n,\tau})\widehat{C}_{n,\tau}+\widehat{\rho}_{n,\tau}\frac{\operatorname{Tr}(\widehat{C}_{n,\tau})}{p}I_p, C n , τ = [ C n ( t j , t k ) ] j , k = 1 p and K n , τ OAS = ( 1 − ρ n , τ ) C n , τ + ρ n , τ p Tr ( C n , τ ) I p ,
where ρ ^ n , τ ∈ [ 0 , 1 ] \widehat{\rho}_{n,\tau} \in[0,1] ρ n , τ ∈ [ 0 , 1 ] is the OAS shrinkage coefficient computed via the analogue of (8) with C ^ n \widehat{C}_n C n replaced by C ^ n , τ \widehat{C}_{n,\tau} C n , τ and G G G replaced by p p p .
Proposition 8. For any matrix norm ∥ ⋅ ∥ \lVert\cdot\rVert ∥ ⋅ ∥ and any compact set C p ⊂ T p C_p \subset\mathcal{T}_p C p ⊂ T p , we have:
(i) ∥ C ^ n − K ∥ → 0 \lVert\widehat{C}_n-K\rVert\to0 ∥ C n − K ∥ → 0 a.s. and sup τ ∈ C p ∥ C ^ n , τ − K τ ∥ → 0 \sup_{\tau\in C_p}\lVert\widehat{C}_{n,\tau}-K_\tau\rVert\to0 sup τ ∈ C p ∥ C n , τ − K τ ∥ → 0 a.s.
(ii) ∥ K ^ n O A S − K ∥ → 0 \lVert\widehat{K}^{\mathrm{OAS}}_n-K\rVert\to0 ∥ K n OAS − K ∥ → 0 a.s. and sup τ ∈ C p ∥ K ^ n , τ O A S − K τ ∥ → 0 \sup_{\tau\in C_p}\lVert\widehat{K}^{\mathrm{OAS}}_{n,\tau}-K_\tau\rVert\to0 sup τ ∈ C p ∥ K n , τ OAS − K τ ∥ → 0 a.s.
This convergence holds under any GP ( μ , K ) \operatorname{GP}(\mu,K) GP ( μ , K ) distribution with continuous sample paths, so both estimators satisfy (A5) simultaneously under P 0 \mathbb{P}_0 P 0 and P μ ∗ \mathbb{P}_{\mu_*} P μ ∗ . The following results simply state that the contraction rates for the plug-in posterior Π ^ n ( ⋅ ∣ X 1 : n ) \widehat{\Pi}_n(\cdot\mid X_{1:n}) Π n ( ⋅ ∣ X 1 : n ) computed using a suitable K ^ n \widehat{K}_n K n do not degrade. The proofs are a refinement of the corresponding ones for the known covariance case, in which the plug-in error is identified and controlled.
Theorem 9. *Suppose (A1)–(A3) and (A5) hold. Then, Π ^ n ( H 1 ∣ X 1 : n ) = O P 0 ( n − p min / 2 ) \widehat{\Pi}_n(H_1\mid X_{1:n})=O_{\mathbb{P}_0}(n^{-p_{\min}/2}) Π n ( H 1 ∣ X 1 : n ) = O P 0 ( n − p m i n /2 ) under H 0 H_0 H 0 .
Theorem 10. *Suppose (A1), (A4) and (A5) hold. Then, Π ^ n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − n γ ) \widehat{\Pi}_n(H_0\mid X_{1:n})=O_{\mathbb{P}_{\mu_*}}(e^{-n\gamma}) Π n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − nγ ) under H 1 H_1 H 1 , for any 0 < γ < 1 2 ∥ μ ∗ ∥ K 2 0<\gamma<\frac{1}{2}\lVert\mu_*\rVert_K^2 0 < γ < 2 1 ∥ μ ∗ ∥ K 2 . Alternatively, if (A1)–(A3), (A4') and (A5) hold, then Π ^ n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − n γ ) \widehat{\Pi}_n(H_0\mid X_{1:n})=O_{\mathbb{P}_{\mu_*}}(e^{-n\gamma}) Π n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − nγ ) under H 1 H_1 H 1 , for any 0 < γ < 1 2 ( ∥ μ ∗ ∥ K 2 − ∥ μ ∗ − μ θ 0 ∥ K 2 ) 0<\gamma<\frac{1}{2}(\lVert\mu_*\rVert_K^2-\lVert\mu_*-\mu_{\theta_0}\rVert_K^2) 0 < γ < 2 1 (∥ μ ∗ ∥ K 2 − ∥ μ ∗ − μ θ 0 ∥ K 2 ) .
On Optimality of the Contraction Rates
An aspect of the theoretical exposition that might stand out is the asymmetry of the contraction rates: polynomial under H 0 H_0 H 0 and exponential under H 1 H_1 H 1 . Intuitively, this disparity can be traced to the spike-and-slab prior (4) placed on the coefficient vector b b b . Because the slab prior assigns nonnegligible mass arbitrarily close to the null region { b = 0 } \{b = 0\} { b = 0 } , under H 0 H_0 H 0 the model struggles to rule out small nonzero mean functions, thereby slowing posterior concentration to the null. In contrast, under H 1 H_1 H 1 the spike prior—a point mass at zero—is well separated from the truth, so the evidence accumulates much faster in favor of the alternative. This heuristic argument is made precise for example by Johnson and Rossell [31 ] , who refer to such priors as “local alternative priors”. Under some regularity conditions, they show that in this case the best achievable rate under a point-null is polynomial, whereas under the alternative the rate is typically exponential.
A natural follow-up question is whether the exponential rate under H 1 H_1 H 1 can be improved, and the answer is negative. For a sequence of frequentist tests in the Neyman–Pearson sense (with bounded type I error probability) comparing a point-null against a simple alternative, the Chernoff–Stein lemma [11 Theorem 11.8.3] states that the optimal decay rate of the type II error probability is exponential, with exponent constant equal to the Kullback–Leibler divergence between the underlying probability distributions. We show in the result below that this information-theoretic bound also applies to our Bayesian test, by thresholding the posterior to produce a frequentist test under the lemma’s purview. Moreover, the Kullback–Leibler divergence in question is precisely D K L ( P μ ∗ ∥ P 0 ) = 1 2 ∥ μ ∗ ∥ K 2 D_{\mathrm{KL}}(P_{\mu^*} \mathbin{\|} P_0) = \frac{1}{2}\lVert\mu^*\rVert_K^2 D KL ( P μ ∗ ∥ P 0 ) = 2 1 ∥ μ ∗ ∥ K 2 , so the rate established in Theorem 4 is arbitrarily close to the theoretical optimum.
Proposition 11 There is no ζ > 1 2 ∥ μ ∗ ∥ K 2 \zeta> \frac{1}{2}\lVert\mu^*\rVert_K^2 ζ > 2 1 ∥ μ ∗ ∥ K 2 such that Π n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − n ζ ) \Pi_n(H_0 \mid X_{1:n}) = O_{P_{\mu^*}}(e^{-n\zeta}) Π n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − n ζ ) under H 1 H_1 H 1 .
Numerical Experiments
We illustrate the finite-sample performance of the proposed Bayesian test through a series of experiments with simulated and real data. In both situations the covariance function is assumed unknown and estimated using the plug-in OAS estimator.
Simulation Study
The simulated data comes from three different Gaussian processes (GP’s):
A Brownian motion (BM) with variance σ 2 = 1.5 \sigma^2 = 1.5 σ 2 = 1.5 .
An Ornstein–Uhlenbeck process (OU) with variance σ 2 = 1.5 \sigma^2 = 1.5 σ 2 = 1.5 and scale ℓ = 0.2 \ell= 0.2 ℓ = 0.2 .
A GP with a squared exponential kernel (SE), variance σ 2 = 1.5 \sigma^2 = 1.5 σ 2 = 1.5 and scale ℓ = 0.2 \ell= 0.2 ℓ = 0.2 .
We draw n = 50 n = 50 n = 50 functional samples from each distribution, observed on a discretized grid of G = 100 G = 100 G = 100 equispaced points on [ 0 , 1 ] [0,1] [ 0 , 1 ] . The mean function under H 0 H_0 H 0 is μ 0 = 0 \mu_0 = 0 μ 0 = 0 , and under H 1 H_1 H 1 we consider two alternatives: a function in H 0 ( K ) \mathcal{H}_0(\mathcal{K}) H 0 ( K ) and a periodic function, given by
μ ∗ R K H S ( t ) = 0.2 K ( 0.15 , t ) − 0.3 K ( 0.4 , t ) + 0.5 K ( 0.75 , t ) and μ ∗ P ( t ) = 0.3 sin ( 2 π t ) , \mu_*^{\mathrm{RKHS}}(t) = 0.2K(0.15,t) - 0.3K(0.4,t) + 0.5K(0.75,t) \quad\text{and} \quad\mu_*^{\mathrm{P}}(t) = 0.3\sin(2\pi t), μ ∗ RKHS ( t ) = 0.2 K ( 0.15 , t ) − 0.3 K ( 0.4 , t ) + 0.5 K ( 0.75 , t ) and μ ∗ P ( t ) = 0.3 sin ( 2 π t ) ,
respectively, where K K K is the corresponding covariance kernel in each case. We implement a reduced model with P max = 5 P_{\max}=5 P m a x = 5 components, a uniform prior distribution p ∼ U { 1 , 2 , 3 , 4 , 5 } p \sim\mathcal{U}\{1,2,3,4,5\} p ∼ U { 1 , 2 , 3 , 4 , 5 } , and a uniform prior for the time instants as well (restricted to the grid points in S S S ). Moreover, we assume for simplicity that the null and alternative hypotheses are a priori equally likely, so that π 0 = 1 − π 0 = 1 / 2 \pi_0=1-\pi_0=1/2 π 0 = 1 − π 0 = 1/2 . When choosing the crucial hyperparameter η \eta η one has to be wary of Lindley’s paradox [42 ] . We propose to compute it from the discretized data through the formula
η ^ n = η 0 Tr ( K ^ n O A S ) G , η 0 > 0 , \hat{\eta}_n=\eta_0\sqrt{\frac{\operatorname{Tr}(\widehat{K}_n^{\mathrm{OAS}})}{G}},\qquad\eta_0>0, η ^ n = η 0 G Tr ( K n OAS ) , η 0 > 0 ,
which measures the marginal standard deviation of the process, multiplied by a constant scale term. In this way we allow the prior on b b b to adapt to the scale of the data; we fix a value of η 0 = 1 / 4 \eta_0=1/4 η 0 = 1/4 to allow detection of small signals (preliminary experiments suggest that bigger signals are easily recognized regardless of the value of η 0 \eta_0 η 0 ). Since η ^ n \hat{\eta}_n η ^ n converges in probability to a finite positive constant, this data-dependent choice does not affect the asymptotic properties of the test. Indeed, since Tr ( K ^ n O A S ) = Tr ( C ^ n ) \operatorname{Tr}(\widehat{K}_n^{\mathrm{OAS}})=\operatorname{Tr}(\widehat{C}_n) Tr ( K n OAS ) = Tr ( C n ) and Tr ( C ^ n ) → Tr ( K ) \operatorname{Tr}(\widehat{C}_n)\to\operatorname{Tr}(K) Tr ( C n ) → Tr ( K ) by Proposition 8, we have η ^ n → η ∞ > 0 \hat{\eta}_n\to\eta_\infty>0 η ^ n → η ∞ > 0 . We can refine the proofs in Appendix B by restricting the arguments to the high-probability event { η ∞ / 2 ≤ η ^ n ≤ 2 η ∞ } \{\eta_\infty/2\leq\hat{\eta}_n\leq2\eta_\infty\} { η ∞ /2 ≤ η ^ n ≤ 2 η ∞ } , on which η ^ n \hat{\eta}_n η ^ n is bounded away from zero and infinity. Since all quantities appearing in the proofs that depend on η \eta η do so in a continuous manner, the constants involved in the corresponding bounds can be chosen uniformly over the compact interval [ η ∞ / 2 , 2 η ∞ ] [\eta_\infty/2,2\eta_\infty] [ η ∞ /2 , 2 η ∞ ] , and the consistency arguments carry over without further modification.
Then, we compare our method (which we call RKBT) to other one-sample testing procedures in the literature:
BON-T. Pointwise t t t -test over all grid points with Bonferroni correction for multiple comparisons. This is the most naive approach, used only as a baseline.
L 2 L^2 L 2 . Global test based on the squared L 2 L^2 L 2 -norm ∥ Δ n ∥ 2 2 = n ∫ 0 1 X ‾ n 2 ( t ) d t \|\Delta_n\|_2^2=n\int_0^1\overline{X}_n^2(t)\,\mathrm{d}t ∥ Δ n ∥ 2 2 = n ∫ 0 1 X n 2 ( t ) d t , whose null distribution is a χ 2 \chi^2 χ 2 -type mixture.
L 2 L^2 L 2 -FPCA. A version of the L 2 L^2 L 2 test with projections through FPCA.
F F F . Global test based on the regularized statistic F n = ∥ Δ n ∥ 2 2 / Tr ( K ^ n ) F_n=\|\Delta_n\|_2^2/\operatorname{Tr}(\widehat{K}_n) F n = ∥ Δ n ∥ 2 2 / Tr ( K n ) , which follows an F F F -type mixture distribution under H 0 H_0 H 0 .
BAYES-FPCA. Standard Bayesian spike-and-slab test with dimension reduction via FPCA and a conjugate g g g -prior under H 1 H_1 H 1 .
The frequentist competitors are primarily those outlined by Zhang [65 ] , whereas the Bayesian competitor arguably represents a novel—albeit simple—approach. A detailed breakdown of the comparison methods is provided in Appendix C.
Performance is measured through several frequentist metrics, repeating the whole procedure 100 times with different random seeds. We compare the rejection rate under H 0 H_0 H 0 (type I error) and under H 1 H_1 H 1 (power), as well as the AUC metric [35 ] , which is a number in [ 0 , 1 ] [0,1] [ 0 , 1 ] that measures the overall ability to correctly distinguish between positive and negative cases across all possible decision thresholds. The frequentist methods are calibrated to the nominal size of α = 0.05 \alpha=0.05 α = 0.05 , and the Bayesian methods are thresholded through the estimated Bayes factor to produce a binary accept/reject decision. Specifically, we use the standard rejection region provided by Jeffreys’ scale (see Table 1 ), which is given by { B F ^ 10 > 3 } \{\widehat{\mathrm{BF}}_{10} > 3\} { BF 10 > 3 } and corresponds to { π ^ n u l l < 1 / 4 } \{\widehat{\pi}_{\mathrm{null}} < 1/4\} { π null < 1/4 } with our prior assumptions.
The results of the simulation study are presented in Table 2 and Table 3 . We can see that our RKBT method has great control of the type I error, while also achieving decent power and AUC in most cases, despite having only a relatively low number of components to work with. Moreover, the comparison methods that obtain a higher power generally do so at the expense of a greater type I error, which may be undesirable. Note that we could increase the power by lowering the rejection threshold, which is fairly conservative, to a point where we still maintain an acceptable type I error (i.e. below 5%). The execution time of our test, although not as fast as the competitors due to the computationally intensive RJMCMC sampling, is still adequate for practical use (see Appendix § 9 for an explicit comparison).
Table 2. Type I error (T1) under H 0 H_0 H 0 , power (P) under the true mean function μ ∗ R K H S \mu_*^{\mathrm{RKHS}} μ ∗ RKHS , and corresponding AUC, averaged over 100 independent replications for the three synthetic data sets (BM, OU, SE). All metrics are reported as percentages (× 10 2 \times10^2 × 1 0 2 ), and the best results within each column are highlighted.
Table 3. Type I error (T1) under H 0 H_0 H 0 , power (P) under the true mean function μ ∗ P \mu_*^P μ ∗ P , and corresponding AUC, averaged over 100 independent replications for the three synthetic data sets (BM, OU, SE). All metrics are reported as percentages (× 10 2 \times10^2 × 1 0 2 ), and the best results within each column are highlighted.
Real Data Application
The metrics in the simulation study are frequentist in nature, but the strength of our Bayesian test lies in the interpretability and the ability to quantify uncertainty. To analyze this aspect, we present a brief case study with real climate data. We consider the average monthly temperature recorded by 24 weather stations in Australia from 1990 to 2019, grouping the curves into three decades: the 1990s (1990–1999), the 2000s (2000–2009), and the 2010s (2010–2019).2 For each station and each decade, we compute a 12-point temperature curve by averaging temperatures within each month across all years in that decade. We then form pairwise differences between the decade-specific curves and apply our test to assess the null hypothesis of no difference in the mean temperature. We use the same prior distributions as in the simulations, but we allow P max = 12 P_{\max}=12 P m a x = 12 and set π 0 = 1 / 3 \pi_0=1/3 π 0 = 1/3 , to convey the widespread belief that the temperature is actually increasing globally.
The Bayesian metrics obtained are summarized in Table 4 . Using the same rejection region as in the simulation study, namely { B F ^ 10 > 3 } \{\widehat{\mathrm{BF}}_{10} > 3\} { BF 10 > 3 } , our test decisively rejects H 0 H_0 H 0 for the second and third period comparisons. This is consistent with the general observation that the climate is getting warmer in recent times. We can also see, for example, that the model gives very low posterior probability to differences of less than 0.1 ∘ C 0.1^\circ\mathrm{C} 0. 1 ∘ C from the 2010s to the 1990s, signalling that the discrepancy is bigger in that case. Note that around five components (months) seem to be sufficient to model the temperature differences, supporting our parsimony assumptions.
Table 4. Estimated posterior metrics given by our RKBT test for the three pairwise-difference temperature data sets: the posterior probability of the null, the Bayes factor, the posterior mean of the number of components in the model, and the ROPE probability Π n ( sup s ∣ μ ( s ) ∣ < 0.1 ∣ X 1 : n ) \Pi_n(\sup_s \lvert\mu(s)\rvert< 0.1\mid X_{1:n}) Π n ( sup s ∣ μ ( s )∣ < 0.1 ∣ X 1 : n ) .
Lastly, Figure 1 provides a useful functional interpretation of the posterior evidence reported in Table 4 , illustrating the posterior mean function μ ^ n P M \hat{\mu}^{\mathrm{PM}}_n μ ^ n PM and the 95% simultaneous bands described in § 2.4 . The estimated mean difference is relatively small and close to zero for the 2000s–1990s comparison, whereas the comparisons involving the 2010s display a markedly positive posterior mean over much of the year, with the largest discrepancy occurring between the 2010s and 1990s. Observe that the variability in the credible bands is generally more pronounced in the warmer months (September–March in the Southern Hemisphere), indicating that the uncertainty is higher precisely where the temperature differences are largest.
Figure 1. Estimated posterior mean and 95% simultaneous credible bands given by our RKBT test for the three pairwise-difference temperature data sets. The empirical mean is also shown for reference.
Discussion
In this work we have described a Bayesian test for the mean μ \mu μ of a Gaussian process, observed through i.i.d. functional samples. The proposed model hinges on a finite-dimensional representation enabled by the reasonable assumption that μ ∈ H ( K ) \mu\in\mathcal{H}(K) μ ∈ H ( K ) , where H ( K ) \mathcal{H}(K) H ( K ) is the RKHS associated with the covariance function K K K of the process. The case μ ∉ H ( K ) \mu\notin\mathcal{H}(K) μ ∈ / H ( K ) , though not treated here, is also interesting in its own right. When the true mean function μ ∗ \mu_* μ ∗ lies outside H ( K ) \mathcal{H}(K) H ( K ) , by the Feldman–Hájek dichotomy the measures P μ ∗ P_{\mu_*} P μ ∗ and P 0 P_0 P 0 are mutually singular, so there exists a Borel set S S S such that P μ ∗ ( S ) = 1 P_{\mu_*}(S) = 1 P μ ∗ ( S ) = 1 and P 0 ( S ) = 0 P_0(S) = 0 P 0 ( S ) = 0 . In principle, we could define the test ϕ ( X ) = 1 { X ∈ S } \phi(X) = \mathbf{1}\{X \in S\} ϕ ( X ) = 1 { X ∈ S } , which has both type I and type II errors equal to zero, and can separate P μ ∗ P_{\mu_*} P μ ∗ and P 0 P_0 P 0 perfectly with a single full observation of the process. This is an example of a “near-perfect” testing situation, in which the functional nature of the data allows exact verification of the null hypothesis in theory. In a discretized setting this effect might not be detectable with a finite grid, but it can manifest as the grid becomes dense [57 ] . Other instances of this phenomenon applied to functional data classification are studied, for example, by Delaigle and Hall [18 ] or Berrendero et al. [4 ] .
The Bayesian formulation of the test is flexible enough to accommodate a range of priors, fixing only the so-called “local” spike-and-slab prior on the coefficient vector b b b , which is a common choice in multivariate settings. Other authors [e.g. 31 ] have objected to local alternative priors on a philosophical level, proposing different nonlocal alternatives. However, adopting them in our context would render the closed-form marginalization of b b b invalid, which is central to our computational strategy. Our approach connects the functional testing problem to a variable-dimension model in a principled way, and is theoretically backed by near-optimal posterior consistency results. These findings confirm that the Bayes factor-based test is asymptotically reliable under both the null and the alternative, and they provide a more refined description of how quickly evidence accumulates in favor of the correct hypothesis. This analysis is complemented by numerical studies with a tractable computational implementation, showing that our test is on a par with other methods in the literature. Lastly, we have also illustrated how the Bayesian aspect of the model can be used to quantify the uncertainty in the posterior distribution and interpret the results of the test, since we have access to a continuous posterior probability that measures the strength of evidence against the null.
We believe that this Bayesian framework opens several compelling paths for future research, demonstrating the practical and theoretical utility of RKHS representations in managing the inherent infinite-dimensionality of functional data. In particular, exploring the role of impact points within the RKHS approximation could yield meaningful new methodologies for change-point detection or variable selection in functional estimation. Furthermore, to our knowledge, the trans-dimensional aspect of the posterior approximation through RJMCMC—together with previous work by Berrendero et al. [5 ] —is a novel contribution in functional data.
Acknowledgments
The authors would like to acknowledge the valuable computational resources provided by the Centro de Computación Científica–Universidad Autónoma de Madrid (CCC–UAM). This research was partially supported by grants PID2023-148081NB-I00 and PRE2020-095147 of the Spanish Ministry of Science and Innovation (MCIN), co-financed by the European Social Fund (ESF). The authors also acknowledge financial support from grant CEX2023-001347-S funded by MICIU/AEI/10.13039/501100011033.
RJMCMC Implementation
The RJMCMC algorithm is used to jointly model the time instants τ p \tau_p τ p and the dimension p p p itself, constructing a Markov chain whose stationary distribution is the intended posterior distribution Π n ( p , τ ∣ X 1 : n ) \Pi_n(p,\tau\mid X_{1:n}) Π n ( p , τ ∣ X 1 : n ) in (6) . To generate new samples, the method considers within-model moves (perturbing the current values of the time instants) and between-model moves (increasing or decreasing the dimension). The former are implemented through minor modifications of the standard Metropolis–Hastings algorithm (Brooks et al. [8 ] ), while the latter are generated by a reversible jump scheme (Richardson and Green [52 ] ). In our simplified setting, the acceptance probability of adding a new component t ∗ t^* t ∗ is given by
α b i r t h = min { 1 , Π ( p + 1 ) Π ( τ ∪ { t ∗ } ∣ p + 1 ) m ( X 1 : n ∣ p + 1 , τ ∪ { t ∗ } ) Π ( p ) Π ( τ ∣ p ) m ( X 1 : n ∣ p , τ ) ⋅ r d e l e t e ( p ) r s e l e c t ( p ) ⋅ g ( t ∗ ) } \alpha_{\mathrm{birth}}=\min\left\{1,\frac{\Pi(p+1)\Pi(\tau\cup\{t^*\}\mid p+1)m(X_{1:n}\mid p+1,\tau\cup\{t^*\})}{\Pi(p)\Pi(\tau\mid p)m(X_{1:n}\mid p,\tau)}\cdot\frac{r_{\mathrm{delete}}(p)}{r_{\mathrm{select}}(p)\cdot g(t^*)}\right\} α birth = min { 1 , Π ( p ) Π ( τ ∣ p ) m ( X 1 : n ∣ p , τ ) Π ( p + 1 ) Π ( τ ∪ { t ∗ } ∣ p + 1 ) m ( X 1 : n ∣ p + 1 , τ ∪ { t ∗ }) ⋅ r select ( p ) ⋅ g ( t ∗ ) r delete ( p ) }
where r s e l e c t ( p ) = 1 / ( P max − p ) r_{\mathrm{select}}(p)=1/(P_{\max}-p) r select ( p ) = 1/ ( P m a x − p ) is the probability of selecting a particular inactive component to become active, r d e l e t e ( p ) = 1 / ( p + 1 ) r_{\mathrm{delete}}(p)=1/(p+1) r delete ( p ) = 1/ ( p + 1 ) is the reverse probability of deleting an existing component at random, and g ( t ∗ ) = 1 g(t^*)=1 g ( t ∗ ) = 1 is the proposal density (uniform in our case). The acceptance probability of removing an existing component is computed similarly to maintain detailed balance, inverting the fractions in the expression above.
The RJMCMC sampling procedure is implemented in Python with the help of the Eryn library (Karnesis et al. [32 ] ), which offers a flexible framework for RJMCMC based on ensembles of walkers (chains). Every walker in the ensemble maintains a set of up to P max P_{\max} P m a x active components, each storing one coordinate t j ∈ S t_j \in\mathcal{S} t j ∈ S . For the experimentation in § 4 we deployed 64 walkers and ran each one for 2500 steps, discarding the first 1500 samples as burn-in (though convergence was typically achieved in fewer steps). Additional hyperparameters for the sampler were selected based on recommendations from the authors and a small set of trial runs. A more thorough description of the Eryn implementation and its internal mechanics is provided by Berrendero et al. [5 ] , along with an application to a similar FDA problem.
Regarding worst-case computational complexity, the RJMCMC procedure evaluates the slab marginal likelihood (5) at each of the W W W walkers and R R R iterations. For a model with p ≤ P max p \le P_{\max} p ≤ P m a x active components, this requires a Cholesky factorization of a p × p p \times p p × p matrix, which can be done in O ( P max 3 ) O(P_{\max}^{3}) O ( P m a x 3 ) . Thus, including the initial O ( n G 2 ) O(nG^{2}) O ( n G 2 ) cost of the empirical covariance estimator (where G G G is the grid size), the overall worst-case time complexity of the RJMCMC sampling is O ( W R P max 3 + n G 2 ) O(WRP_{\max}^{3} + nG^{2}) O ( W R P m a x 3 + n G 2 ) . Keeping a low P max P_{\max} P m a x and a sensible grid size allows the algorithm to run in reasonable time.
It is worth mentioning that in typical mixture-model settings, label switching is a well-known identifiability issue: permuting the component labels ( t j , β j ) (t_j,\beta_j) ( t j , β j ) yields the same likelihood, causing a multimodality in the posterior that can degrade mixing and complicate post-processing. In our case, however, label switching is not a practical concern for two reasons. First, as noted in § 2 , we impose an ordering on the time instants, removing the symmetry and identifying a unique labeling. Second, and more importantly, most posterior quantities of interest are identifiable in the sense that they depend on the mean function parametrization μ θ ( ⋅ ) = ∑ j β j K ( t j , ⋅ ) \mu_{\theta}(\cdot) = \sum_j \beta_j K(t_j,\cdot) μ θ ( ⋅ ) = ∑ j β j K ( t j , ⋅ ) , which is invariant under relabeling, so the functionals we report would be unchanged even if we did not impose an ordering.
Recovering Posterior Samples for the Coefficients
Once the RJMCMC sampling for ( p , τ ) (p,\tau) ( p , τ ) is complete, we can generate posterior draws of b b b by applying Bayes’ formula analytically (conditional on p p p and τ \tau τ ). The corresponding posterior expression is
Π n ( b ∣ p , τ , X 1 : n ) = ψ n ( p , τ ) δ 0 ( b ) + ( 1 − ψ n ( p , τ ) ) Π n s l a b ( b ∣ p , τ , X 1 : n ) , \Pi_n(b\mid p,\tau,X_{1:n}) = \psi_n(p,\tau)\delta_0(b) + (1-\psi_n(p,\tau))\Pi_n^{\mathrm{slab}}(b\mid p,\tau,X_{1:n}), Π n ( b ∣ p , τ , X 1 : n ) = ψ n ( p , τ ) δ 0 ( b ) + ( 1 − ψ n ( p , τ )) Π n slab ( b ∣ p , τ , X 1 : n ) ,
where ψ n ( p , τ ) \psi_n(p,\tau) ψ n ( p , τ ) is the conditional posterior probability of the spike event, defined in (7) . For the slab part, we have Π n s l a b ( b ∣ p , τ , X 1 : n ) ∝ Π s l a b ( b ) L ( X 1 : n ∣ p , τ , b ) \Pi_n^{\mathrm{slab}}(b\mid p,\tau,X_{1:n}) \propto\Pi^{\mathrm{slab}}(b)L(X_{1:n}\mid p,\tau,b) Π n slab ( b ∣ p , τ , X 1 : n ) ∝ Π slab ( b ) L ( X 1 : n ∣ p , τ , b ) , so that
Π n s l a b ( b ∣ p , τ , X 1 : n ) ∝ N p ( b ∣ 0 , η 2 I p ) exp { S n ( τ ) ′ b − n 2 b ′ K τ b } ∝ exp { − 1 2 ( b − Λ τ − 1 S n ( τ ) ) ′ Λ τ ( b − Λ τ − 1 S n ( τ ) ) } . \begin{aligned}
\Pi_n^{\mathrm{slab}}(b\mid p,\tau,X_{1:n}) &\propto\mathcal{N}_p(b\mid0,\eta^2 I_p)\exp\left\{S_n(\tau)^\prime b-\frac{n}{2}b^\prime K_\tau b\right\}\\
&\propto\exp\left\{-\frac{1}{2}(b-\Lambda_\tau^{-1}S_n(\tau))^\prime\Lambda_\tau(b-\Lambda_\tau^{-1}S_n(\tau))\right\}.
\end{aligned} Π n slab ( b ∣ p , τ , X 1 : n ) ∝ N p ( b ∣ 0 , η 2 I p ) exp { S n ( τ ) ′ b − 2 n b ′ K τ b } ∝ exp { − 2 1 ( b − Λ τ − 1 S n ( τ ) ) ′ Λ τ ( b − Λ τ − 1 S n ( τ )) } .
Hence, b ∣ p , τ , X 1 : n , s l a b ∼ N p ( Λ τ − 1 S n ( τ ) , Λ τ − 1 ) b\mid p,\tau,X_{1:n},\mathrm{slab}\sim\mathcal{N}_p(\Lambda_\tau^{-1}S_n(\tau),\Lambda_\tau^{-1}) b ∣ p , τ , X 1 : n , slab ∼ N p ( Λ τ − 1 S n ( τ ) , Λ τ − 1 ) . Thus, after a full RJMCMC run with R R R posterior samples ( p ( r ) , τ ( r ) ) (p^{(r)},\tau^{(r)}) ( p ( r ) , τ ( r ) ) , we can retrieve the corresponding posterior samples b ( r ) b^{(r)} b ( r ) through the following simple procedure:
Draw a spike or slab event Z ( r ) ∼ Bernoulli ( ψ n ( p ( r ) , τ ( r ) ) ) Z^{(r)}\sim\operatorname{Bernoulli}(\psi_n(p^{(r)},\tau^{(r)})) Z ( r ) ∼ Bernoulli ( ψ n ( p ( r ) , τ ( r ) )) .
If Z ( r ) = 1 Z^{(r)}=1 Z ( r ) = 1 , set b ( r ) = 0 b^{(r)}=0 b ( r ) = 0 . If Z ( r ) = 0 Z^{(r)}=0 Z ( r ) = 0 , sample b ( r ) b^{(r)} b ( r ) from N p ( r ) ( Λ τ ( r ) − 1 S n ( τ ( r ) ) , Λ τ ( r ) − 1 ) \mathcal{N}_{p^{(r)}}(\Lambda_{\tau^{(r)}}^{-1}S_n(\tau^{(r)}),\Lambda_{\tau^{(r)}}^{-1}) N p ( r ) ( Λ τ ( r ) − 1 S n ( τ ( r ) ) , Λ τ ( r ) − 1 ) .
Proofs
Here we present the proofs of the theoretical results in § 3 . Keep in mind that the covariance function K K K is strictly positive definite. Moreover, because the data are Gaussian, under (A1) both μ \mu μ and K K K are continuous functions.3 To see this, let t n → t t_n \to t t n → t and u n → u u_n \to u u n → u in [ 0 , 1 ] [0,1] [ 0 , 1 ] . Since the sample paths are continuous a.s., ( X ( t n ) , X ( u n ) ) → ( X ( t ) , X ( u ) ) (X(t_n),X(u_n)) \to(X(t),X(u)) ( X ( t n ) , X ( u n )) → ( X ( t ) , X ( u )) in distribution. By the Portmanteau lemma, the corresponding characteristic functions converge pointwise, and hence μ ( t n ) → μ ( t ) \mu(t_n) \to\mu(t) μ ( t n ) → μ ( t ) and K ( t n , u n ) → K ( t , u ) K(t_n,u_n) \to K(t,u) K ( t n , u n ) → K ( t , u ) , because a Gaussian process is completely determined by its mean and covariance functions.
Using Bayes’ rule (6) for the posterior of ( p , τ ) (p,\tau) ( p , τ ) and writing the normalization constant explicitly, the posterior probability of the alternative is given by
Π n ( H 1 ∣ X 1 : n ) = ( 1 − π 0 ) m 1 ( X 1 : n ) π 0 + ( 1 − π 0 ) m 1 ( X 1 : n ) . (9) \Pi_n(H_1\mid X_{1:n})=\frac{(1-\pi_0)m_1(X_{1:n})}{\pi_0+(1-\pi_0)m_1(X_{1:n})}. \tag*{(9)} Π n ( H 1 ∣ X 1 : n ) = π 0 + ( 1 − π 0 ) m 1 ( X 1 : n ) ( 1 − π 0 ) m 1 ( X 1 : n ) . (9)
where
m 1 ( X 1 : n ) = ∑ p ≥ 1 Π ( p ) ∫ T p m s l a b ( X 1 : n ∣ p , τ ) Π ( τ ∣ p ) d τ . (10) m_1(X_{1:n})=\sum_{p\ge1}\Pi(p)\int_{\mathcal{T}_p}m_{\mathrm{slab}}(X_{1:n}\mid p,\tau)\Pi(\tau\mid p)\,\mathrm{d}\tau. \tag*{(10)} m 1 ( X 1 : n ) = p ≥ 1 ∑ Π ( p ) ∫ T p m slab ( X 1 : n ∣ p , τ ) Π ( τ ∣ p ) d τ . (10)
Consistency and Contraction Rates for Known Covariance
For notational convenience, define
I n , p ( U ) = ∫ U m s l a b ( X 1 : n ∣ p , τ ) Π ( τ ∣ p ) d τ , for every U ⊆ T p . I_{n,p}(U)=\int_U m_{\mathrm{slab}}(X_{1:n}\mid p,\tau)\Pi(\tau\mid p)\,\mathrm{d}\tau,\qquad\text{for every }U\subseteq\mathcal{T}_p. I n , p ( U ) = ∫ U m slab ( X 1 : n ∣ p , τ ) Π ( τ ∣ p ) d τ , for every U ⊆ T p .
Proof of Theorem 2
Proof Under (A2) and (A3), the sum m 1 ( X 1 : n ) m_1(X_{1:n}) m 1 ( X 1 : n ) simplifies to
m 1 ( X 1 : n ) = ∑ p = p min P max Π ( p ) I n , p ( C p ) . m_1(X_{1:n})=\sum_{p=p_{\min}}^{P_{\max}}\Pi(p)I_{n,p}(\mathcal{C}_p). m 1 ( X 1 : n ) = p = p m i n ∑ P m a x Π ( p ) I n , p ( C p ) .
Fix p min ≤ p ≤ P max p_{\min}\le p\le P_{\max} p m i n ≤ p ≤ P m a x and let ε > 0 \varepsilon>0 ε > 0 . Note that the minimum eigenvalue function τ ↦ λ min ( K τ ) \tau\mapsto\lambda_{\min}(K_\tau) τ ↦ λ m i n ( K τ ) is continuous by Weyl’s inequality [6 Theorem VI.2.1] and the continuity of K K K . Because C p \mathcal{C}_p C p is compact and K τ K_\tau K τ is strictly positive definite, there exists λ p > 0 \lambda_p>0 λ p > 0 with
λ min ( K τ ) ≥ λ p > 0 for all τ ∈ C p . \lambda_{\min}(K_\tau)\ge\lambda_p>0\qquad\text{for all }\tau\in\mathcal{C}_p. λ m i n ( K τ ) ≥ λ p > 0 for all τ ∈ C p .
Since Λ τ = n K τ + η − 2 I p \Lambda_\tau=nK_\tau+\eta^{-2}I_p Λ τ = n K τ + η − 2 I p , this implies that λ min ( Λ τ ) = n λ min ( K τ ) + η − 2 ≥ n λ p > 0 \lambda_{\min}(\Lambda_\tau)=n\lambda_{\min}(K_\tau)+\eta^{-2}\ge n\lambda_p>0 λ m i n ( Λ τ ) = n λ m i n ( K τ ) + η − 2 ≥ n λ p > 0 for all τ ∈ C p \tau\in\mathcal{C}_p τ ∈ C p . Therefore, the following holds for all τ ∈ C p \tau\in\mathcal{C}_p τ ∈ C p :
(i) ∣ Λ τ ∣ ≥ ( n λ p ) p |\Lambda_\tau|\ge(n\lambda_p)^p ∣ Λ τ ∣ ≥ ( n λ p ) p .
(ii) v ′ Λ τ − 1 v ≤ 1 n λ p ∥ v ∥ 2 v^\prime\Lambda_\tau^{-1}v\le\frac{1}{n\lambda_p}\lVert v\rVert^2 v ′ Λ τ − 1 v ≤ n λ p 1 ∥ v ∥ 2 for any v ≠ 0 v\ne0 v = 0 . Only the second assertion deserves a comment: the Rayleigh quotient of a symmetric matrix is bounded above by its maximum eigenvalue [26 Theorem 4.2.2] , and we have λ max ( Λ τ − 1 ) = ( λ min ( Λ τ ) ) − 1 \lambda_{\max}(\Lambda_{\tau}^{-1}) = (\lambda_{\min}(\Lambda_{\tau}))^{-1} λ m a x ( Λ τ − 1 ) = ( λ m i n ( Λ τ ) ) − 1 . Combining (i), (ii) and (5) yields the upper bound
m s l a b ( X 1 : n ∣ p , τ ) ≤ η − p ( n λ p ) − p / 2 exp { 1 2 n λ p ∥ S n ( τ ) ∥ 2 } , for all τ ∈ C p . (11) m_{\mathrm{slab}}(X_{1:n}|p,\tau) \le\eta^{-p}(n\lambda_p)^{-p/2}\exp\left\{\frac{1}{2n\lambda_p}\lVert S_n(\tau)\rVert^2\right\}, \quad\text{for all }\tau\in C_p. \tag*{(11)} m slab ( X 1 : n ∣ p , τ ) ≤ η − p ( n λ p ) − p /2 exp { 2 n λ p 1 ∥ S n ( τ ) ∥ 2 } , for all τ ∈ C p . (11)
Now define Z τ = S n ( τ ) / n Z_\tau= S_n(\tau)/\sqrt{n} Z τ = S n ( τ ) / n for each τ \tau τ , and note that Z τ ∼ N p ( 0 , K τ ) Z_\tau\sim\mathcal{N}_p(0,K_\tau) Z τ ∼ N p ( 0 , K τ ) under H 0 H_0 H 0 , so its distribution is independent of n n n . Since
sup τ ∈ C p ∥ S n ( τ ) ∥ 2 n = sup τ ∈ C p ∥ Z τ ∥ 2 , \sup_{\tau\in C_p}\frac{\lVert S_n(\tau)\rVert^2}{n}=\sup_{\tau\in C_p}\lVert Z_\tau\rVert^2, τ ∈ C p sup n ∥ S n ( τ ) ∥ 2 = τ ∈ C p sup ∥ Z τ ∥ 2 ,
we consider for any M > 0 M>0 M > 0 the P 0 \mathbb{P}_0 P 0 -measurable event
E M = { sup τ ∈ C p ∥ Z τ ∥ 2 ≤ M } . (12) E_M=\left\{\sup_{\tau\in C_p}\lVert Z_\tau\rVert^2\le M\right\}. \tag*{(12)} E M = { τ ∈ C p sup ∥ Z τ ∥ 2 ≤ M } . (12)
The map τ ↦ Z τ ( ω ) \tau\mapsto Z_\tau(\omega) τ ↦ Z τ ( ω ) is continuous for almost every ω \omega ω by (A1), so on the compact set C p C_p C p and the points of continuity in ω \omega ω , the continuous function τ ↦ ∥ Z τ ( ω ) ∥ 2 \tau\mapsto\lVert Z_\tau(\omega)\rVert^2 τ ↦ ∥ Z τ ( ω ) ∥ 2 attains its supremum. Hence, sup τ ∈ C p ∥ Z τ ∥ 2 < ∞ \sup_{\tau\in C_p}\lVert Z_\tau\rVert^2<\infty sup τ ∈ C p ∥ Z τ ∥ 2 < ∞ almost surely, which trivially implies that we can choose M M M large enough so that the complement E M c E_M^c E M c is negligible in probability, say P 0 ( E M c ) < ε \mathbb{P}_0(E_M^c)<\varepsilon P 0 ( E M c ) < ε .
On the other hand, on E M E_M E M the upper bound in (11) reduces to the deterministic bound
sup τ ∈ C p m s l a b ( X 1 : n ∣ p , τ ) ≤ η − p ( n λ p ) − p / 2 exp { M 2 λ p } . (13) \sup_{\tau\in C_p}m_{\mathrm{slab}}(X_{1:n}|p,\tau)\le\eta^{-p}(n\lambda_p)^{-p/2}\exp\left\{\frac{M}{2\lambda_p}\right\}. \tag*{(13)} τ ∈ C p sup m slab ( X 1 : n ∣ p , τ ) ≤ η − p ( n λ p ) − p /2 exp { 2 λ p M } . (13)
Since Π τ ( C p ∣ p ) = 1 \Pi_\tau(C_p|p)=1 Π τ ( C p ∣ p ) = 1 , by (13) we have (still on the event E M E_M E M )
I n , p ( C p ) ≤ sup τ ∈ C p m s l a b ( X 1 : n ∣ p , τ ) ∫ C p Π ( τ ∣ p ) d τ ≤ D n − p / 2 , I_{n,p}(C_p)\le\sup_{\tau\in C_p}m_{\mathrm{slab}}(X_{1:n}|p,\tau)\int_{C_p}\Pi(\tau|p)\,d\tau\le Dn^{-p/2}, I n , p ( C p ) ≤ τ ∈ C p sup m slab ( X 1 : n ∣ p , τ ) ∫ C p Π ( τ ∣ p ) d τ ≤ D n − p /2 ,
where D > 0 D>0 D > 0 is a constant independent of n n n . Hence, for sufficiently large n n n we have
P 0 ( I n , p ( C p ) > D n − p / 2 ) ≤ P 0 ( E M c ) < ε , \mathbb{P}_0(I_{n,p}(C_p)>Dn^{-p/2})\le\mathbb{P}_0(E_M^c)<\varepsilon, P 0 ( I n , p ( C p ) > D n − p /2 ) ≤ P 0 ( E M c ) < ε ,
so I n , p ( C p ) = O P 0 ( n − p / 2 ) I_{n,p}(C_p)=O_{\mathbb{P}_0}(n^{-p/2}) I n , p ( C p ) = O P 0 ( n − p /2 ) . Write I n , p ( C p ) = n − p / 2 Y n , p I_{n,p}(C_p)=n^{-p/2}Y_{n,p} I n , p ( C p ) = n − p /2 Y n , p , where Y n , p = O P 0 ( 1 ) Y_{n,p}=O_{\mathbb{P}_0}(1) Y n , p = O P 0 ( 1 ) by definition. Then, because the dominant term in the finite sum m 1 ( X 1 : n ) m_1(X_{1:n}) m 1 ( X 1 : n ) is the first term, we have
m 1 ( X 1 : n ) = ∑ p = p min p max Π ( p ) n − p / 2 Y n , p = O P 0 ( n − p min / 2 ) . m_1(X_{1:n})=\sum_{p=p_{\min}}^{p_{\max}}\Pi(p)n^{-p/2}Y_{n,p}=O_{\mathbb{P}_0}(n^{-p_{\min}/2}). m 1 ( X 1 : n ) = p = p m i n ∑ p m a x Π ( p ) n − p /2 Y n , p = O P 0 ( n − p m i n /2 ) .
Lastly, note that
Π n ( H 1 ∣ X 1 : n ) ≤ 1 − π 0 π 0 m 1 ( X 1 : n ) , \Pi_n(H_1|X_{1:n})\le\frac{1-\pi_0}{\pi_0}m_1(X_{1:n}), Π n ( H 1 ∣ X 1 : n ) ≤ π 0 1 − π 0 m 1 ( X 1 : n ) ,
so by the continuous mapping theorem the stochastic bound translates immediately and
Π n ( H 1 ∣ X 1 : n ) = O P 0 ( n − p min / 2 ) , \Pi_n(H_1|X_{1:n})=O_{\mathbb{P}_0}(n^{-p_{\min}/2}), Π n ( H 1 ∣ X 1 : n ) = O P 0 ( n − p m i n /2 ) ,
as claimed.
Proof of Theorem 4
Proof The RKHS framework will allow us to work, via a suitable approximation, in a finite-dimensional setting. First, since H 0 ( K ) \mathcal{H}_0(K) H 0 ( K ) is dense in H ( K ) \mathcal{H}(K) H ( K ) , for any ε > 0 \varepsilon> 0 ε > 0 there exists a parameter θ ε = ( p ε , τ ε , b ε ) \theta_\varepsilon= (p_\varepsilon,\tau_\varepsilon,b_\varepsilon) θ ε = ( p ε , τ ε , b ε ) such that
∥ μ ∗ − μ τ ε , b ε ∥ K < ε , (14) \lVert\mu_*-\mu_{\tau_\varepsilon,b_\varepsilon}\rVert_K < \varepsilon, \tag*{(14)} ∥ μ ∗ − μ τ ε , b ε ∥ K < ε , (14)
where μ τ ε , b ε \mu_{\tau_\varepsilon,b_\varepsilon} μ τ ε , b ε is shorthand for μ θ ε \mu_{\theta_\varepsilon} μ θ ε . Since μ ∗ ≠ 0 \mu_* \ne0 μ ∗ = 0 , choosing ε \varepsilon ε small enough (e.g. ε ≤ ∥ μ ∗ ∥ K \varepsilon\le\lVert\mu_*\rVert_K ε ≤ ∥ μ ∗ ∥ K ) guarantees that μ τ ε , b ε ≠ 0 \mu_{\tau_\varepsilon,b_\varepsilon} \ne0 μ τ ε , b ε = 0 , and hence b ε ≠ 0 b_\varepsilon\ne0 b ε = 0 . By (A4), Π ( p ε ) > 0 \Pi(p_\varepsilon) > 0 Π ( p ε ) > 0 and there exists a neighborhood U = U 1 × U 2 U = U_1 \times U_2 U = U 1 × U 2 of ( τ ε , b ε ) (\tau_\varepsilon,b_\varepsilon) ( τ ε , b ε ) within T p ε × R p ε \mathcal{T}_{p_\varepsilon} \times\mathbb{R}^{p_\varepsilon} T p ε × R p ε with positive prior probability. We can (and do) take U 1 U_1 U 1 and U 2 U_2 U 2 compact, and arrange 0 ∉ U 2 0 \notin U_2 0 ∈ / U 2 .
Let ( τ , b ) ∈ U (\tau,b) \in U ( τ , b ) ∈ U and define μ ∗ ( τ ) = ( μ ∗ ( t 1 ) , … , μ ∗ ( t p ε ) ) ′ \mu_*(\tau) = (\mu_*(t_1),\ldots,\mu_*(t_{p_\varepsilon}))^\prime μ ∗ ( τ ) = ( μ ∗ ( t 1 ) , … , μ ∗ ( t p ε ) ) ′ and Z τ = ( S n ( τ ) − n μ ∗ ( τ ) ) / n Z_\tau= (S_n(\tau)-n\mu_*(\tau))/\sqrt{n} Z τ = ( S n ( τ ) − n μ ∗ ( τ )) / n . Note that Z τ ∼ N p ε ( 0 , K τ ) Z_\tau\sim N_{p_\varepsilon}(0,K_\tau) Z τ ∼ N p ε ( 0 , K τ ) under H 1 H_1 H 1 , so its distribution is independent of n n n . Substituting in (3) yields
log L ( X 1 : n ∣ p ε , τ , b ) = n μ ∗ ( τ ) ′ b − n 2 b ′ K τ b + n Z τ ′ b . (15) \log L(X_{1:n}\mid p_\varepsilon,\tau,b) = n\mu_*(\tau)^\prime b-\frac{n}{2}b^\prime K_\tau b+\sqrt{n}Z_\tau^\prime b. \tag*{(15)} log L ( X 1 : n ∣ p ε , τ , b ) = n μ ∗ ( τ ) ′ b − 2 n b ′ K τ b + n Z τ ′ b . (15)
On the one hand, for ( τ , b ) ∈ U (\tau,b) \in U ( τ , b ) ∈ U define the function
f ( τ , b ) = μ ∗ ( τ ) ′ b − 1 2 b ′ K τ b = μ ∗ ( τ ) ′ b − 1 2 ∥ μ τ , b ∥ K 2 , f(\tau,b)=\mu_*(\tau)^\prime b-\frac{1}{2}b^\prime K_\tau b=\mu_*(\tau)^\prime b-\frac{1}{2}\lVert\mu_{\tau,b}\rVert_K^2, f ( τ , b ) = μ ∗ ( τ ) ′ b − 2 1 b ′ K τ b = μ ∗ ( τ ) ′ b − 2 1 ∥ μ τ , b ∥ K 2 ,
and observe that by the reproducing property and the linearity of the inner product we have
⟨ μ ∗ , μ τ , b ⟩ K = ⟨ μ ∗ , ∑ j = 1 p ε β j K ( t j , ⋅ ) ⟩ K = ∑ j = 1 p ε β j ⟨ μ ∗ , K ( t j , ⋅ ) ⟩ K = μ ∗ ( τ ) ′ b . \langle\mu_*,\mu_{\tau,b}\rangle_K=\left\langle\mu_*,\sum_{j=1}^{p_\varepsilon}\beta_jK(t_j,\cdot)\right\rangle_K=\sum_{j=1}^{p_\varepsilon}\beta_j\langle\mu_*,K(t_j,\cdot)\rangle_K=\mu_*(\tau)^\prime b. ⟨ μ ∗ , μ τ , b ⟩ K = ⟨ μ ∗ , j = 1 ∑ p ε β j K ( t j , ⋅ ) ⟩ K = j = 1 ∑ p ε β j ⟨ μ ∗ , K ( t j , ⋅ ) ⟩ K = μ ∗ ( τ ) ′ b .
Thus, using the familiar identity ∥ f − g ∥ 2 = ∥ f ∥ 2 + ∥ g ∥ 2 − 2 ⟨ f , g ⟩ \lVert f-g\rVert^2=\lVert f\rVert^2+\lVert g\rVert^2-2\langle f,g\rangle ∥ f − g ∥ 2 = ∥ f ∥ 2 + ∥ g ∥ 2 − 2 ⟨ f , g ⟩ , we can write
f ( τ , b ) = ⟨ μ ∗ , μ τ , b ⟩ K − 1 2 ∥ μ τ , b ∥ K 2 = 1 2 ∥ μ ∗ ∥ K 2 − 1 2 ∥ μ ∗ − μ τ , b ∥ K 2 . f(\tau,b)=\langle\mu_*,\mu_{\tau,b}\rangle_K-\frac{1}{2}\lVert\mu_{\tau,b}\rVert_K^2=\frac{1}{2}\lVert\mu_*\rVert_K^2-\frac{1}{2}\lVert\mu_*-\mu_{\tau,b}\rVert_K^2. f ( τ , b ) = ⟨ μ ∗ , μ τ , b ⟩ K − 2 1 ∥ μ τ , b ∥ K 2 = 2 1 ∥ μ ∗ ∥ K 2 − 2 1 ∥ μ ∗ − μ τ , b ∥ K 2 .
Moreover, by the triangle inequality we have
∥ μ ∗ − μ τ , b ∥ K ≤ ∥ μ ∗ − μ τ ε , b ε ∥ K + ∥ μ τ ε , b ε − μ τ , b ∥ K . \lVert\mu_*-\mu_{\tau,b}\rVert_K\le\lVert\mu_*-\mu_{\tau_\varepsilon,b_\varepsilon}\rVert_K+\lVert\mu_{\tau_\varepsilon,b_\varepsilon}-\mu_{\tau,b}\rVert_K. ∥ μ ∗ − μ τ , b ∥ K ≤ ∥ μ ∗ − μ τ ε , b ε ∥ K + ∥ μ τ ε , b ε − μ τ , b ∥ K .
Then, by (14) and the continuity of the map ( τ , b ) ↦ μ τ , b (\tau,b)\mapsto\mu_{\tau,b} ( τ , b ) ↦ μ τ , b in the RKHS norm (which follows from the continuity of K K K ), after shrinking U U U if necessary we have ∥ μ ∗ − μ τ , b ∥ K < 2 ε \lVert\mu_*-\mu_{\tau,b}\rVert_K<2\varepsilon ∥ μ ∗ − μ τ , b ∥ K < 2 ε for all ( τ , b ) ∈ U (\tau,b)\in U ( τ , b ) ∈ U . Consequently,
f ( τ , b ) ≥ 1 2 ∥ μ ∗ ∥ K 2 − 2 ε 2 = : c ε > 0 , f(\tau,b)\ge\frac{1}{2}\lVert\mu_*\rVert_K^2-2\varepsilon^2=:c_\varepsilon>0, f ( τ , b ) ≥ 2 1 ∥ μ ∗ ∥ K 2 − 2 ε 2 =: c ε > 0 ,
where positivity holds by choosing ε \varepsilon ε small enough. On the other hand, note that by the Cauchy–Schwarz inequality
n Z τ ′ b ≥ n ⋅ inf b ∈ U 2 Z τ ′ b ≥ − n ⋅ sup b ∈ U 2 ∥ b ∥ ⋅ sup τ ∈ U 1 ∥ Z τ ∥ . \sqrt{n}Z_\tau^\prime b\ge\sqrt{n}\cdot\inf_{b\in U_2}Z_\tau^\prime b\ge-\sqrt{n}\cdot\sup_{b\in U_2}\lVert b\rVert\cdot\sup_{\tau\in U_1}\lVert Z_\tau\rVert. n Z τ ′ b ≥ n ⋅ b ∈ U 2 inf Z τ ′ b ≥ − n ⋅ b ∈ U 2 sup ∥ b ∥ ⋅ τ ∈ U 1 sup ∥ Z τ ∥ .
All in all, we see from (15) that for all ( τ , b ) ∈ U (\tau,b)\in U ( τ , b ) ∈ U we obtain a uniform lower bound for the log-likelihood given by
log L ( X 1 : n ∣ p ε , τ , b ) = n f ( τ , b ) + n Z τ ′ b ≥ n c ε − n B ⋅ sup τ ∈ U 1 ∥ Z τ ∥ , \log L(X_{1:n}\mid p_\varepsilon,\tau,b)=nf(\tau,b)+\sqrt{n}Z_\tau^\prime b\ge nc_\varepsilon-\sqrt{n}B\cdot\sup_{\tau\in U_1}\lVert Z_\tau\rVert, log L ( X 1 : n ∣ p ε , τ , b ) = n f ( τ , b ) + n Z τ ′ b ≥ n c ε − n B ⋅ τ ∈ U 1 sup ∥ Z τ ∥ ,
where B = sup b ∈ U 2 ∥ b ∥ B = \sup_{b \in U_2} \lVert b \rVert B = sup b ∈ U 2 ∥ b ∥ satisfies 0 < B < ∞ 0 < B < \infty 0 < B < ∞ , since U 2 U_2 U 2 is a compact set with 0 ∉ U 2 0 \notin U_2 0 ∈ / U 2 . Hence, by (10) and (5), we have
m 1 ( X 1 : n ) ≥ Π ( p ε ) ∫ U 1 ∫ U 2 N p ε ( b ∣ 0 , η 2 I p ε ) exp { n f ( τ , b ) + n Z τ ′ b } Π ( τ ∣ p ε ) d b d τ ≥ D exp { n c ε − n B ⋅ sup τ ∈ U 1 ∥ Z τ ∥ } , (16) \begin{aligned}
m_1(X_{1:n}) &\ge\Pi(p_\varepsilon) \int_{U_1} \int_{U_2} N_{p_\varepsilon}(b \mid0,\eta^2 I_{p_\varepsilon}) \exp\{n f(\tau,b) + \sqrt{n}Z'_\tau b\}\Pi(\tau\mid p_\varepsilon)\,db\,d\tau\\
&\ge D \exp\left\{n c_\varepsilon- \sqrt{n}B \cdot\sup_{\tau\in U_1}\lVert Z_\tau\rVert\right\}, \tag*{(16)}
\end{aligned} m 1 ( X 1 : n ) ≥ Π ( p ε ) ∫ U 1 ∫ U 2 N p ε ( b ∣ 0 , η 2 I p ε ) exp { n f ( τ , b ) + n Z τ ′ b } Π ( τ ∣ p ε ) d b d τ ≥ D exp { n c ε − n B ⋅ τ ∈ U 1 sup ∥ Z τ ∥ } , (16)
where D = Π ( p ε ) Π τ ( U 1 ∣ p ε ) Π b s l a b ( U 2 ∣ p ε ) > 0 D = \Pi(p_\varepsilon)\Pi_\tau(U_1\mid p_\varepsilon)\Pi_b^{\mathrm{slab}}(U_2\mid p_\varepsilon) > 0 D = Π ( p ε ) Π τ ( U 1 ∣ p ε ) Π b slab ( U 2 ∣ p ε ) > 0 by assumption. Next, note that sup τ ∈ U 1 ∥ Z τ ∥ \sup_{\tau\in U_1}\lVert Z_\tau\rVert sup τ ∈ U 1 ∥ Z τ ∥ is O P μ ∗ ( 1 ) O_{\mathbb{P}_{\mu_*}}(1) O P μ ∗ ( 1 ) (by the same argument as in the proof of Theorem 2), so for all δ > 0 \delta> 0 δ > 0 there exists M > 0 M > 0 M > 0 such that P μ ∗ ( B ⋅ sup τ ∈ U 1 ∥ Z τ ∥ ≥ M ) < δ \mathbb{P}_{\mu_*}(B\cdot\sup_{\tau\in U_1}\lVert Z_\tau\rVert\ge M)<\delta P μ ∗ ( B ⋅ sup τ ∈ U 1 ∥ Z τ ∥ ≥ M ) < δ . Thus, by (16) we get
P μ ∗ ( m 1 ( X 1 : n ) ≤ D exp { n c ε − n M } ) ≤ P μ ∗ ( B ⋅ sup τ ∈ U 1 ∥ Z τ ∥ ≥ M ) < δ . \mathbb{P}_{\mu_*}\left(m_1(X_{1:n})\le D\exp\{n c_\varepsilon-\sqrt{n}M\}\right)\le\mathbb{P}_{\mu_*}\left(B\cdot\sup_{\tau\in U_1}\lVert Z_\tau\rVert\ge M\right)<\delta. P μ ∗ ( m 1 ( X 1 : n ) ≤ D exp { n c ε − n M } ) ≤ P μ ∗ ( B ⋅ τ ∈ U 1 sup ∥ Z τ ∥ ≥ M ) < δ .
Since n c ε / ( 1 + ε ) n c_\varepsilon/(1+\varepsilon) n c ε / ( 1 + ε ) grows slower than n c ε − n M n c_\varepsilon-\sqrt{n}M n c ε − n M as n → ∞ n\to\infty n → ∞ , for sufficiently large n n n we get the probability bound
P μ ∗ ( m 1 ( X 1 : n ) ≤ D exp { n c ε / ( 1 + ε ) } ) ≤ P μ ∗ ( m 1 ( X 1 : n ) ≤ D exp { n c ε − n M } ) < δ . \mathbb{P}_{\mu_*}\left(m_1(X_{1:n})\le D\exp\{n c_\varepsilon/(1+\varepsilon)\}\right)\le\mathbb{P}_{\mu_*}\left(m_1(X_{1:n})\le D\exp\{n c_\varepsilon-\sqrt{n}M\}\right)<\delta. P μ ∗ ( m 1 ( X 1 : n ) ≤ D exp { n c ε / ( 1 + ε )} ) ≤ P μ ∗ ( m 1 ( X 1 : n ) ≤ D exp { n c ε − n M } ) < δ .
To conclude, observe that by (9)
Π n ( H 0 ∣ X 1 : n ) = π 0 π 0 + ( 1 − π 0 ) m 1 ( X 1 : n ) ≤ π 0 ( 1 − π 0 ) m 1 ( X 1 : n ) , \Pi_n(H_0\mid X_{1:n})=\frac{\pi_0}{\pi_0+(1-\pi_0)m_1(X_{1:n})}\le\frac{\pi_0}{(1-\pi_0)m_1(X_{1:n})}, Π n ( H 0 ∣ X 1 : n ) = π 0 + ( 1 − π 0 ) m 1 ( X 1 : n ) π 0 ≤ ( 1 − π 0 ) m 1 ( X 1 : n ) π 0 ,
so if we define D ~ = π 0 / ( ( 1 − π 0 ) D ) \widetilde{D}=\pi_0/((1-\pi_0)D) D = π 0 / (( 1 − π 0 ) D ) , for large n n n we have
P μ ∗ ( Π n ( H 0 ∣ X 1 : n ) > D ~ exp { − n c ε 1 + ε } ) ≤ P μ ∗ ( m 1 ( X 1 : n ) ≤ D exp { n c ε 1 + ε } ) < δ , \mathbb{P}_{\mu_*}\left(\Pi_n(H_0\mid X_{1:n})>\widetilde{D}\exp\left\{\frac{-n c_\varepsilon}{1+\varepsilon}\right\}\right)\le\mathbb{P}_{\mu_*}\left(m_1(X_{1:n})\le D\exp\left\{\frac{n c_\varepsilon}{1+\varepsilon}\right\}\right)<\delta, P μ ∗ ( Π n ( H 0 ∣ X 1 : n ) > D exp { 1 + ε − n c ε } ) ≤ P μ ∗ ( m 1 ( X 1 : n ) ≤ D exp { 1 + ε n c ε } ) < δ ,
i.e., Π n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − n c ε / ( 1 + ε ) ) \Pi_n(H_0\mid X_{1:n})=O_{\mathbb{P}_{\mu_*}}(e^{-n c_\varepsilon/(1+\varepsilon)}) Π n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − n c ε / ( 1 + ε ) ) . Since ε \varepsilon ε was arbitrarily small, the constant γ \gamma γ in the exponent is as close as desired to lim ε → 0 c ε / ( 1 + ε ) = 1 2 ∥ μ ∗ ∥ K 2 \lim_{\varepsilon\to0}c_\varepsilon/(1+\varepsilon)=\frac{1}{2}\lVert\mu_*\rVert_K^2 lim ε → 0 c ε / ( 1 + ε ) = 2 1 ∥ μ ∗ ∥ K 2 .
Proof of Theorem 6
Proof By (A4′), there exist p 0 ≤ P max p_0\le P_{\max} p 0 ≤ P m a x , τ 0 ∈ C p 0 \tau_0\in\mathcal{C}_{p_0} τ 0 ∈ C p 0 , and b 0 ∈ R p 0 ∖ { 0 } b_0\in\mathbb{R}^{p_0}\setminus\{0\} b 0 ∈ R p 0 ∖ { 0 } such that
ξ : = ∥ μ ∗ − μ τ 0 , b 0 ∥ K < ∥ μ ∗ ∥ K . \xi:= \lVert\mu_*-\mu_{\tau_0,b_0}\rVert_K < \lVert\mu_*\rVert_K. ξ := ∥ μ ∗ − μ τ 0 , b 0 ∥ K < ∥ μ ∗ ∥ K .
By the full support condition in (A4′), there exists a compact neighborhood U = U 1 × U 2 U=U_1\times U_2 U = U 1 × U 2 of ( τ 0 , b 0 ) (\tau_0,b_0) ( τ 0 , b 0 ) within C p 0 × R p 0 ∖ { 0 } \mathcal{C}_{p_0}\times\mathbb{R}^{p_0}\setminus\{0\} C p 0 × R p 0 ∖ { 0 } with Π ( p 0 ) Π τ ( U 1 ∣ p 0 ) Π b s l a b ( U 2 ∣ p 0 ) > 0 \Pi(p_0)\Pi_\tau(U_1\mid p_0)\Pi_b^{\mathrm{slab}}(U_2\mid p_0)>0 Π ( p 0 ) Π τ ( U 1 ∣ p 0 ) Π b slab ( U 2 ∣ p 0 ) > 0 . Let ( τ , b ) ∈ U (\tau,b)\in U ( τ , b ) ∈ U and define f ( τ , b ) f(\tau,b) f ( τ , b ) as in the proof of Theorem 4, i.e.,
f ( τ , b ) = 1 2 ∥ μ ∗ ∥ K 2 − 1 2 ∥ μ ∗ − μ τ , b ∥ K 2 . f(\tau,b)=\frac{1}{2}\lVert\mu_*\rVert_K^2-\frac{1}{2}\lVert\mu_*-\mu_{\tau,b}\rVert_K^2. f ( τ , b ) = 2 1 ∥ μ ∗ ∥ K 2 − 2 1 ∥ μ ∗ − μ τ , b ∥ K 2 .
Let ε > 0 \varepsilon>0 ε > 0 be small enough so that ξ + ε < ∥ μ ∗ ∥ K \xi+\varepsilon<\lVert\mu_*\rVert_K ξ + ε < ∥ μ ∗ ∥ K . By shrinking U U U we can ensure that ∥ μ τ 0 , b 0 − μ τ , b ∥ K < ε \lVert\mu_{\tau_0,b_0}-\mu_{\tau,b}\rVert_K<\varepsilon ∥ μ τ 0 , b 0 − μ τ , b ∥ K < ε , and then by the triangle inequality we have ∥ μ ∗ − μ τ , b ∥ K ≤ ξ + ε \lVert\mu_*-\mu_{\tau,b}\rVert_K\le\xi+\varepsilon ∥ μ ∗ − μ τ , b ∥ K ≤ ξ + ε . Therefore,
f ( τ , b ) ≥ 1 2 ∥ μ ∗ ∥ K 2 − 1 2 ( ξ + ε ) 2 = : c ε , ξ > 0 for all ( τ , b ) ∈ U , f(\tau,b)\ge\frac{1}{2}\lVert\mu_*\rVert_K^2-\frac{1}{2}(\xi+\varepsilon)^2=:c_{\varepsilon,\xi}>0\quad\text{for all }(\tau,b)\in U, f ( τ , b ) ≥ 2 1 ∥ μ ∗ ∥ K 2 − 2 1 ( ξ + ε ) 2 =: c ε , ξ > 0 for all ( τ , b ) ∈ U ,
where positivity holds because ξ + ε < ∥ μ ∗ ∥ K \xi+\varepsilon< \|\mu_*\|_K ξ + ε < ∥ μ ∗ ∥ K . From this point on, we proceed exactly as in the proof of Theorem 4 , obtaining Π n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − n c ε , ξ / ( 1 + ε ) ) \Pi_n(H_0\mid X_{1:n}) = O_{\mathbb{P}_{\mu_*}}(e^{-nc_{\varepsilon,\xi}/(1+\varepsilon)}) Π n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − n c ε , ξ / ( 1 + ε ) ) . Letting ε → 0 \varepsilon\to0 ε → 0 gives a constant γ \gamma γ in the exponent as close as desired to 1 2 ( ∥ μ ∗ ∥ K 2 − ξ 2 ) \frac{1}{2}(\|\mu_*\|_K^2-\xi^2) 2 1 ( ∥ μ ∗ ∥ K 2 − ξ 2 ) .
Consistency and Contraction Rates for Plug-in Covariance
Firstly, note that under (A1) the empirical covariance estimator C ^ n \widehat{C}_n C n is uniformly consistent almost surely, i.e.,
∥ C ^ n − K ∥ ∞ → a . s . 0 ( n → ∞ ) , (17) \|\widehat{C}_n-K\|_\infty\xrightarrow{\mathrm{a.s.}} 0 \quad(n\to\infty), \tag*{(17)} ∥ C n − K ∥ ∞ a.s. 0 ( n → ∞ ) , (17)
where ∥ ⋅ ∥ ∞ \|\cdot\|_\infty ∥ ⋅ ∥ ∞ is the supremum norm. This follows directly from Mourier’s law of large numbers in Banach spaces (Laha and Rohatgi, [36 ] ) and the fact that E [ ∥ X ∥ ∞ 2 ] = E [ sup t ∣ X ( t ) ∣ 2 ] < ∞ \mathbb{E}[\|X\|_\infty^2]=\mathbb{E}[\sup_t|X(t)|^2]<\infty E [ ∥ X ∥ ∞ 2 ] = E [ sup t ∣ X ( t ) ∣ 2 ] < ∞ . To establish the finiteness of the second moment under the supremum norm, Landau and Shepp [38 ] showed that E [ e ε ∥ X ∥ ∞ 2 ] < ∞ \mathbb{E}[e^{\varepsilon\|X\|_\infty^2}]<\infty E [ e ε ∥ X ∥ ∞ 2 ] < ∞ for sufficiently small ε > 0 \varepsilon>0 ε > 0 , which immediately implies E [ ∥ X ∥ ∞ 2 ] < ∞ \mathbb{E}[\|X\|_\infty^2]<\infty E [ ∥ X ∥ ∞ 2 ] < ∞ .
Proof of Proposition 8
Proof The first assertion in (i) is a consequence of the scalar law of large numbers applied entrywise. Alternatively, it can be immediately deduced from (17) by choosing the max-norm on matrices (since all matrix norms are equivalent):
∥ C ^ n − K ∥ max = max 1 ≤ g , h ≤ G ∣ C ^ n ( s g , s h ) − K ( s g , s h ) ∣ ≤ ∥ C ^ n − K ∥ ∞ → a . s . 0. \|\widehat{C}_n-K\|_{\max}=\max_{1\leq g,h\leq G}|\widehat{C}_n(s_g,s_h)-K(s_g,s_h)|\leq\|\widehat{C}_n-K\|_\infty\xrightarrow{\mathrm{a.s.}}0. ∥ C n − K ∥ m a x = 1 ≤ g , h ≤ G max ∣ C n ( s g , s h ) − K ( s g , s h ) ∣ ≤ ∥ C n − K ∥ ∞ a.s. 0.
The second assertion is proven analogously.
For (ii), note that Tr ( ⋅ ) \operatorname{Tr}(\cdot) Tr ( ⋅ ) is continuous, so from (i) we have
Tr ( C ^ n ) → a . s . Tr ( K ) and Tr ( C ^ n 2 ) → a . s . Tr ( K 2 ) . \operatorname{Tr}(\widehat{C}_n)\xrightarrow{\mathrm{a.s.}}\operatorname{Tr}(K)\quad\text{and}\quad\operatorname{Tr}(\widehat{C}_n^2)\xrightarrow{\mathrm{a.s.}}\operatorname{Tr}(K^2). Tr ( C n ) a.s. Tr ( K ) and Tr ( C n 2 ) a.s. Tr ( K 2 ) .
Then, the numerator in ρ ^ n \widehat{\rho}_n ρ n , defined in (8), converges almost surely to a finite positive constant (as long as G ≥ 2 G\geq2 G ≥ 2 ). For the denominator, observe that
Tr ( C ^ n 2 ) − 1 G Tr 2 ( C ^ n ) → a . s . Tr ( K 2 ) − 1 G Tr 2 ( K ) . (18) \operatorname{Tr}(\widehat{C}_n^2)-\frac{1}{G}\operatorname{Tr}^2(\widehat{C}_n)\xrightarrow{\mathrm{a.s.}}\operatorname{Tr}(K^2)-\frac{1}{G}\operatorname{Tr}^2(K). \tag*{(18)} Tr ( C n 2 ) − G 1 Tr 2 ( C n ) a.s. Tr ( K 2 ) − G 1 Tr 2 ( K ) . (18)
By Cauchy–Schwarz (using the definition of the trace as the sum of the eigenvalues), the right-hand side of (18) is always nonnegative, and it vanishes if and only if the true covariance matrix K K K is spherical. Thus, we consider two cases:
If, say, K = σ 2 I G K=\sigma^2 I_G K = σ 2 I G with σ 2 > 0 \sigma^2>0 σ 2 > 0 , then the behavior of ρ ^ n \widehat{\rho}_n ρ n as n → ∞ n\to\infty n → ∞ is not easily determined (though it can be analyzed by a central limit theorem argument). Luckily this is irrelevant, since now both the empirical covariance and target covariance matrices converge a.s. to the same limit, namely K K K . Then,
∥ K ^ n O A S − K ∥ ≤ ( 1 − ρ ^ n ) ∥ C ^ n − K ∥ + ρ ^ n ∥ Tr ( C ^ n ) G I G − K ∥ → a . s . 0. \|\widehat{K}^{\mathrm{OAS}}_n-K\|\leq(1-\widehat{\rho}_n)\|\widehat{C}_n-K\|+\widehat{\rho}_n\left\|\frac{\operatorname{Tr}(\widehat{C}_n)}{G}I_G-K\right\|\xrightarrow{\mathrm{a.s.}}0. ∥ K n OAS − K ∥ ≤ ( 1 − ρ n ) ∥ C n − K ∥ + ρ n G Tr ( C n ) I G − K a.s. 0.
If K K K is not spherical, then ∥ Tr ( C ^ n ) I G / G − K ∥ \left\lVert\operatorname{Tr}(\widehat{C}_n) I_{G/G}-K\right\rVert Tr ( C n ) I G / G − K converges to a finite constant almost surely. On the other hand, the denominator in (8) diverges almost surely as n → ∞ n \to\infty n → ∞ , so ρ ^ n ⟶ a . s . 0 \widehat{\rho}_n \overset{\mathrm{a.s.}}{\longrightarrow} 0 ρ n ⟶ a.s. 0 . Then, using the same upper bound as in the previous case, we also get ∥ K ^ n O A S − K ∥ → 0 \left\lVert\widehat{K}^{\mathrm{OAS}}_n-K\right\rVert\to0 K n OAS − K → 0 a.s.
We now prove the second assertion in (ii) in detail. The case p = 1 p=1 p = 1 is trivial, so we assume p > 1 p>1 p > 1 . By the triangle inequality and particularizing to the Frobenius norm ∥ ⋅ ∥ F \lVert\cdot\rVert_F ∥ ⋅ ∥ F , we have
sup τ ∈ C p ∥ K ^ n , τ O A S − K τ ∥ F ≤ sup τ ∈ C p ∥ C ^ n , τ − K τ ∥ F + sup τ ∈ C p ρ ^ n , τ ∥ Tr ( C ^ n , τ ) p I p − C ^ n , τ ∥ F . \sup_{\tau\in\mathcal{C}_p}\left\lVert\widehat{K}^{\mathrm{OAS}}_{n,\tau}-K_\tau\right\rVert_F
\le
\sup_{\tau\in\mathcal{C}_p}\left\lVert\widehat{C}_{n,\tau}-K_\tau\right\rVert_F
+
\sup_{\tau\in\mathcal{C}_p}\widehat{\rho}_{n,\tau}
\left\lVert\frac{\operatorname{Tr}(\widehat{C}_{n,\tau})}{p}I_p-\widehat{C}_{n,\tau}\right\rVert_F . τ ∈ C p sup K n , τ OAS − K τ F ≤ τ ∈ C p sup C n , τ − K τ F + τ ∈ C p sup ρ n , τ p Tr ( C n , τ ) I p − C n , τ F .
The first term on the right-hand side goes to 0 almost surely by the uniform convergence established in (i). For the second term, let
D ^ n , τ = Tr ( C ^ n , τ ) p I p − C ^ n , τ , \widehat{D}_{n,\tau}=\frac{\operatorname{Tr}(\widehat{C}_{n,\tau})}{p}I_p-\widehat{C}_{n,\tau}, D n , τ = p Tr ( C n , τ ) I p − C n , τ ,
and note that ∥ D ^ n , τ ∥ F 2 = Tr ( D ^ n , τ D ^ n , τ ′ ) = Tr ( C ^ n , τ 2 ) − Tr 2 ( C ^ n , τ ) / p \lVert\widehat{D}_{n,\tau}\rVert_F^2=\operatorname{Tr}(\widehat{D}_{n,\tau}\widehat{D}_{n,\tau}^{\prime})=\operatorname{Tr}(\widehat{C}_{n,\tau}^2)-\operatorname{Tr}^2(\widehat{C}_{n,\tau})/p ∥ D n , τ ∥ F 2 = Tr ( D n , τ D n , τ ′ ) = Tr ( C n , τ 2 ) − Tr 2 ( C n , τ ) / p . Then, for τ ∈ C p \tau\in\mathcal{C}_p τ ∈ C p we have
ρ ^ n , τ ∥ Tr ( C ^ n , τ ) p I p − C ^ n , τ ∥ F = min { 1 , N ^ n , τ ( n + 1 − 2 / p ) ∥ D ^ n , τ ∥ F 2 } ∥ D ^ n , τ ∥ F . (19) \widehat{\rho}_{n,\tau}\left\lVert\frac{\operatorname{Tr}(\widehat{C}_{n,\tau})}{p}I_p-\widehat{C}_{n,\tau}\right\rVert_F
=
\min\left\{1,\frac{\widehat{N}_{n,\tau}}{(n+1-2/p)\lVert\widehat{D}_{n,\tau}\rVert_F^2}\right\}\lVert\widehat{D}_{n,\tau}\rVert_F . \tag*{(19)} ρ n , τ p Tr ( C n , τ ) I p − C n , τ F = min { 1 , ( n + 1 − 2/ p ) ∥ D n , τ ∥ F 2 N n , τ } ∥ D n , τ ∥ F . (19)
where N ^ n , τ = ( 1 − 2 / p ) Tr ( C ^ n , τ 2 ) + Tr 2 ( C ^ n , τ ) ≥ 0 \widehat{N}_{n,\tau}=(1-2/p)\operatorname{Tr}(\widehat{C}_{n,\tau}^2)+\operatorname{Tr}^2(\widehat{C}_{n,\tau})\ge0 N n , τ = ( 1 − 2/ p ) Tr ( C n , τ 2 ) + Tr 2 ( C n , τ ) ≥ 0 . Now, for any A ≥ 0 A\ge0 A ≥ 0 , c > 0 c>0 c > 0 and x ≥ 0 x\ge0 x ≥ 0 the algebraic inequality min { 1 , A c x 2 } x ≤ A c \min\left\{1,\frac{A}{cx^2}\right\}x\le\sqrt{\frac{A}{c}} min { 1 , c x 2 A } x ≤ c A holds (if x ≤ A / c x\le\sqrt{A/c} x ≤ A / c the bound is trivial since the minimum is at most 1; if x > A / c x>\sqrt{A/c} x > A / c it evaluates to A c x 2 x \frac{A}{cx^2}x c x 2 A x , and in turn A c x 2 x < A / c \frac{A}{cx^2}x<\sqrt{A/c} c x 2 A x < A / c ). Applying this bound to (19) yields
ρ ^ n , τ ∥ D ^ n , τ ∥ F ≤ N ^ n , τ n + 1 − 2 / p . \widehat{\rho}_{n,\tau}\lVert\widehat{D}_{n,\tau}\rVert_F
\le
\sqrt{\frac{\widehat{N}_{n,\tau}}{n+1-2/p}}. ρ n , τ ∥ D n , τ ∥ F ≤ n + 1 − 2/ p N n , τ .
To conclude, we show that N ^ n , τ \widehat{N}_{n,\tau} N n , τ is uniformly bounded almost surely for large n n n . To see this, define the continuous map F : R p × p → R F:\mathbb{R}^{p\times p}\to\mathbb{R} F : R p × p → R given by F ( A ) = ( 1 − 2 / p ) Tr ( A 2 ) + Tr 2 ( A ) F(A)=(1-2/p)\operatorname{Tr}(A^2)+\operatorname{Tr}^2(A) F ( A ) = ( 1 − 2/ p ) Tr ( A 2 ) + Tr 2 ( A ) . Note that the set { K τ : τ ∈ C p } \{K_\tau:\tau\in\mathcal{C}_p\} { K τ : τ ∈ C p } is compact, so uniform convergence of C ^ n , τ \widehat{C}_{n,\tau} C n , τ to K τ K_\tau K τ , given by (i), implies that for large n n n all C ^ n , τ \widehat{C}_{n,\tau} C n , τ lie almost surely in a fixed compact neighborhood of this set. The function F F F is uniformly continuous on this compact neighborhood, and therefore
sup τ ∈ C p ∣ F ( C ^ n , τ ) − F ( K τ ) ∣ = sup τ ∈ C p ∣ N ^ n , τ − F ( K τ ) ∣ ⟶ a . s . 0. \sup_{\tau\in\mathcal{C}_p}\left|F(\widehat{C}_{n,\tau})-F(K_\tau)\right|
=
\sup_{\tau\in\mathcal{C}_p}\left|\widehat{N}_{n,\tau}-F(K_\tau)\right|
\overset{\mathrm{a.s.}}{\longrightarrow}0. τ ∈ C p sup F ( C n , τ ) − F ( K τ ) = τ ∈ C p sup N n , τ − F ( K τ ) ⟶ a.s. 0.
This implies that sup τ ∈ C p N ^ n , τ ≤ sup τ ∈ C p F ( K τ ) + 1 = : M \sup_{\tau\in\mathcal{C}_p}\widehat{N}_{n,\tau}\le\sup_{\tau\in\mathcal{C}_p}F(K_\tau)+1=:M sup τ ∈ C p N n , τ ≤ sup τ ∈ C p F ( K τ ) + 1 =: M a.s. for all n n n large enough, and M < ∞ M<\infty M < ∞ by continuity. Hence,
sup τ ∈ C p ρ ^ n , τ ∥ D ^ n , τ ∥ F ≤ M n + 1 − 2 / p ⟶ a . s . 0. \sup_{\tau\in\mathcal{C}_p}\widehat{\rho}_{n,\tau}\lVert\widehat{D}_{n,\tau}\rVert_F
\le
\sqrt{\frac{M}{n+1-2/p}}
\overset{\mathrm{a.s.}}{\longrightarrow}0. τ ∈ C p sup ρ n , τ ∥ D n , τ ∥ F ≤ n + 1 − 2/ p M ⟶ a.s. 0.
We now prove the plug-in consistency results for our test. Define the plug-in marginal likelihood
m ^ s l a b ( X 1 : n ∣ p , τ ) = η − p ∣ Λ ^ n , τ ∣ − 1 / 2 exp { 1 2 S n ( τ ) ′ Λ ^ n , τ − 1 S n ( τ ) } , \widehat{m}_{\mathrm{slab}}(X_{1:n}\mid p,\tau)=\eta^{-p}\lvert\widehat{\Lambda}_{n,\tau}\rvert^{-1/2}\exp\left\{\frac{1}{2}S_n(\tau)^{\prime}\widehat{\Lambda}_{n,\tau}^{-1}S_n(\tau)\right\}, m slab ( X 1 : n ∣ p , τ ) = η − p ∣ Λ n , τ ∣ − 1/2 exp { 2 1 S n ( τ ) ′ Λ n , τ − 1 S n ( τ ) } ,
where Λ ^ n , τ = n K ^ n , τ + η − 2 I p \widehat{\Lambda}_{n,\tau}=n\widehat{K}_{n,\tau}+\eta^{-2}I_p Λ n , τ = n K n , τ + η − 2 I p . Similarly, consider the plug-in posterior probability of the alternative
Π ^ n ( H 1 ∣ X 1 : n ) = ( 1 − π 0 ) m ^ 1 ( X 1 : n ) π 0 + ( 1 − π 0 ) m ^ 1 ( X 1 : n ) , \widehat{\Pi}_n(H_1\mid X_{1:n})=\frac{(1-\pi_0)\widehat{m}_1(X_{1:n})}{\pi_0+(1-\pi_0)\widehat{m}_1(X_{1:n})}, Π n ( H 1 ∣ X 1 : n ) = π 0 + ( 1 − π 0 ) m 1 ( X 1 : n ) ( 1 − π 0 ) m 1 ( X 1 : n ) ,
where
m ^ 1 ( X 1 : n ) = ∑ p ≥ 1 Π ( p ) ∫ T p m ^ s l a b ( X 1 : n ∣ p , τ ) Π ( τ ∣ p ) d τ . \widehat{m}_1(X_{1:n})=\sum_{p\geq1}\Pi(p)\int_{\mathcal{T}_p}\widehat{m}_{\mathrm{slab}}(X_{1:n}\mid p,\tau)\Pi(\tau\mid p)\,d\tau. m 1 ( X 1 : n ) = p ≥ 1 ∑ Π ( p ) ∫ T p m slab ( X 1 : n ∣ p , τ ) Π ( τ ∣ p ) d τ .
Proof of Theorem 9
Proof We will follow the proof of Theorem 2 and adapt it only where necessary. First, observe that by (A2) and (A3) the sum m ^ 1 ( X 1 : n ) \widehat{m}_1(X_{1:n}) m 1 ( X 1 : n ) reduces to
m ^ 1 ( X 1 : n ) = ∑ p = p min P max Π ( p ) I ^ n , p ( C p ) , \widehat{m}_1(X_{1:n})=\sum_{p=p_{\min}}^{P_{\max}}\Pi(p)\widehat{I}_{n,p}(\mathcal{C}_p), m 1 ( X 1 : n ) = p = p m i n ∑ P m a x Π ( p ) I n , p ( C p ) ,
where I ^ n , p ( C p ) = ∫ C p m ^ s l a b ( X 1 : n ∣ p , τ ) Π ( τ ∣ p ) d τ \widehat{I}_{n,p}(\mathcal{C}_p)=\int_{\mathcal{C}_p}\widehat{m}_{\mathrm{slab}}(X_{1:n}\mid p,\tau)\Pi(\tau\mid p)\,d\tau I n , p ( C p ) = ∫ C p m slab ( X 1 : n ∣ p , τ ) Π ( τ ∣ p ) d τ . Fix p min ≤ p ≤ P max p_{\min}\leq p\leq P_{\max} p m i n ≤ p ≤ P m a x , and recall that there exists λ p > 0 \lambda_p>0 λ p > 0 with λ min ( K τ ) ≥ λ p \lambda_{\min}(K_\tau)\geq\lambda_p λ m i n ( K τ ) ≥ λ p for all τ ∈ C p \tau\in\mathcal{C}_p τ ∈ C p . By Weyl’s inequality, choosing the spectral norm ∥ ⋅ ∥ 2 \lVert\cdot\rVert_2 ∥ ⋅ ∥ 2 on matrices, we have
λ min ( K ^ n , τ ) ≥ λ min ( K τ ) − ∥ K ^ n , τ − K τ ∥ 2 ≥ λ p − sup τ ∈ C p ∥ K ^ n , τ − K τ ∥ 2 . \lambda_{\min}(\widehat{K}_{n,\tau})\geq\lambda_{\min}(K_\tau)-\lVert\widehat{K}_{n,\tau}-K_\tau\rVert_2\geq\lambda_p-\sup_{\tau\in\mathcal{C}_p}\lVert\widehat{K}_{n,\tau}-K_\tau\rVert_2. λ m i n ( K n , τ ) ≥ λ m i n ( K τ ) − ∥ K n , τ − K τ ∥ 2 ≥ λ p − τ ∈ C p sup ∥ K n , τ − K τ ∥ 2 .
Define the event where K ^ n , τ \widehat{K}_{n,\tau} K n , τ is uniformly close to K τ K_\tau K τ with a suitable bound, i.e.,
F n = { sup τ ∈ C p ∥ K ^ n , τ − K τ ∥ 2 ≤ λ p 2 } , F_n=\left\{\sup_{\tau\in\mathcal{C}_p}\lVert\widehat{K}_{n,\tau}-K_\tau\rVert_2\leq\frac{\lambda_p}{2}\right\}, F n = { τ ∈ C p sup ∥ K n , τ − K τ ∥ 2 ≤ 2 λ p } ,
and note that P 0 ( F n c ) → 0 \mathbb{P}_0(F_n^c)\to0 P 0 ( F n c ) → 0 as n → ∞ n\to\infty n → ∞ by (A5). Furthermore, λ min ( K ^ n , τ ) ≥ λ p / 2 \lambda_{\min}(\widehat{K}_{n,\tau})\geq\lambda_p/2 λ m i n ( K n , τ ) ≥ λ p /2 for all τ ∈ C p \tau\in\mathcal{C}_p τ ∈ C p on F n F_n F n , and consequently λ min ( Λ ^ n , τ ) ≥ n λ p / 2 > 0 \lambda_{\min}(\widehat{\Lambda}_{n,\tau})\geq n\lambda_p/2>0 λ m i n ( Λ n , τ ) ≥ n λ p /2 > 0 . On F n F_n F n , this yields the upper bound
m ^ s l a b ( X 1 : n ∣ p , τ ) ≤ η − p ( n λ p 2 ) − p / 2 exp { 1 n λ p ∥ S n ( τ ) ∥ 2 } , for all τ ∈ C p . (20) \widehat{m}_{\mathrm{slab}}(X_{1:n}\mid p,\tau)\leq\eta^{-p}\left(\frac{n\lambda_p}{2}\right)^{-p/2}\exp\left\{\frac{1}{n\lambda_p}\lVert S_n(\tau)\rVert^2\right\},\qquad\text{for all }\tau\in\mathcal{C}_p. \tag*{(20)} m slab ( X 1 : n ∣ p , τ ) ≤ η − p ( 2 n λ p ) − p /2 exp { n λ p 1 ∥ S n ( τ ) ∥ 2 } , for all τ ∈ C p . (20)
Let ϵ > 0 \epsilon>0 ϵ > 0 and define the event E M E_M E M for a large enough M M M as in (12) , so that P 0 ( E M c ) < ϵ / 2 \mathbb{P}_0(E_M^c)<\epsilon/2 P 0 ( E M c ) < ϵ /2 . On the high-probability event F n ∩ E M F_n\cap E_M F n ∩ E M , incorporating (20) gives after integration
I ^ n , p ( C p ) ≤ η − p ( n λ p 2 ) − p / 2 exp { M λ p } = : D ^ n − p / 2 , \widehat{I}_{n,p}(\mathcal{C}_p)\leq\eta^{-p}\left(\frac{n\lambda_p}{2}\right)^{-p/2}\exp\left\{\frac{M}{\lambda_p}\right\}=:\widehat{D}\,n^{-p/2}, I n , p ( C p ) ≤ η − p ( 2 n λ p ) − p /2 exp { λ p M } =: D n − p /2 ,
where D ^ = η − p ( λ p / 2 ) − p / 2 exp { M / λ p } \widehat{D}=\eta^{-p}(\lambda_p/2)^{-p/2}\exp\{M/\lambda_p\} D = η − p ( λ p /2 ) − p /2 exp { M / λ p } is a finite constant independent of n n n . Then, for sufficiently large n n n ,
P 0 ( I ^ n , p ( C p ) > D ^ n − p / 2 ) ≤ P 0 ( F n c ) + P 0 ( E M c ) < ϵ , \mathbb{P}_0\left(\widehat{I}_{n,p}(\mathcal{C}_p)>\widehat{D}n^{-p/2}\right)\leq\mathbb{P}_0(F_n^c)+\mathbb{P}_0(E_M^c)<\epsilon, P 0 ( I n , p ( C p ) > D n − p /2 ) ≤ P 0 ( F n c ) + P 0 ( E M c ) < ϵ ,
showing I ^ n , p ( C p ) = O P 0 ( n − p / 2 ) \widehat{I}_{n,p}(\mathcal{C}_p)=O_{\mathbb{P}_0}(n^{-p/2}) I n , p ( C p ) = O P 0 ( n − p /2 ) . Then, we conclude exactly as in the proof of Theorem 2. ■
Proof of Theorem 10
Proof We follow the proof strategy of Theorem 4. Recover the approximating point ( p ϵ , τ ϵ , b ϵ ) (p_\epsilon,\tau_\epsilon,b_\epsilon) ( p ϵ , τ ϵ , b ϵ ) , the compact neighborhood U = U 1 × U 2 U=U_1\times U_2 U = U 1 × U 2 of ( τ ϵ , b ϵ ) (\tau_\epsilon,b_\epsilon) ( τ ϵ , b ϵ ) with positive prior probability, and the function f ( τ , b ) = μ ∗ ( τ ) ′ b − 1 2 b ′ K τ b f(\tau,b)=\mu_*(\tau)'b-\frac{1}{2}b'K_\tau b f ( τ , b ) = μ ∗ ( τ ) ′ b − 2 1 b ′ K τ b , which satisfies f ( τ , b ) ≥ 1 2 ∥ μ ∗ ∥ K 2 − 2 ϵ 2 > 0 f(\tau,b)\geq\frac{1}{2}\|\mu_*\|_K^2-2\epsilon^2>0 f ( τ , b ) ≥ 2 1 ∥ μ ∗ ∥ K 2 − 2 ϵ 2 > 0 for all ( τ , b ) ∈ U (\tau,b)\in U ( τ , b ) ∈ U and sufficiently small ϵ > 0 \epsilon>0 ϵ > 0 . Define the plug-in analogue
f ^ n ( τ , b ) = μ ∗ ( τ ) ′ b − 1 2 b ′ K ^ n , τ b , for all ( τ , b ) ∈ U , \widehat{f}_n(\tau,b)=\mu_*(\tau)'b-\frac{1}{2}b'\widehat{K}_{n,\tau}b,\qquad\text{for all }(\tau,b)\in U, f n ( τ , b ) = μ ∗ ( τ ) ′ b − 2 1 b ′ K n , τ b , for all ( τ , b ) ∈ U ,
and bound the plug-in error by
sup ( τ , b ) ∈ U ∣ f ^ n ( τ , b ) − f ( τ , b ) ∣ = sup ( τ , b ) ∈ U 1 2 ∣ b ′ ( K ^ n , τ − K τ ) b ∣ ≤ B 2 2 sup τ ∈ U 1 ∥ K ^ n , τ − K τ ∥ 2 , \sup_{(\tau,b)\in U}|\widehat{f}_n(\tau,b)-f(\tau,b)|=\sup_{(\tau,b)\in U}\frac{1}{2}|b'(\widehat{K}_{n,\tau}-K_\tau)b|\leq\frac{B^2}{2}\sup_{\tau\in U_1}\|\widehat{K}_{n,\tau}-K_\tau\|_2, ( τ , b ) ∈ U sup ∣ f n ( τ , b ) − f ( τ , b ) ∣ = ( τ , b ) ∈ U sup 2 1 ∣ b ′ ( K n , τ − K τ ) b ∣ ≤ 2 B 2 τ ∈ U 1 sup ∥ K n , τ − K τ ∥ 2 ,
where 0 < B = sup b ∈ U 2 ∥ b ∥ < ∞ 0<B=\sup_{b\in U_2}\|b\|<\infty 0 < B = sup b ∈ U 2 ∥ b ∥ < ∞ and ∥ ⋅ ∥ 2 \|\cdot\|_2 ∥ ⋅ ∥ 2 is the spectral norm on matrices. Now, define the event
G n = { sup τ ∈ U 1 ∥ K ^ n , τ − K τ ∥ 2 ≤ 2 ϵ 2 B 2 } . G_n=\left\{\sup_{\tau\in U_1}\|\widehat{K}_{n,\tau}-K_\tau\|_2\leq\frac{2\epsilon^2}{B^2}\right\}. G n = { τ ∈ U 1 sup ∥ K n , τ − K τ ∥ 2 ≤ B 2 2 ϵ 2 } .
On the one hand, by (A5) we have P μ ∗ ( G n c ) → 0 \mathbb{P}_{\mu_*}(G_n^c)\to0 P μ ∗ ( G n c ) → 0 as n → ∞ n\to\infty n → ∞ . On the other hand, on G n G_n G n ,
f ^ n ( τ , b ) ≥ f ( τ , b ) − ϵ 2 ≥ 1 2 ∥ μ ∗ ∥ K 2 − 3 ϵ 2 = : d ϵ , for all ( τ , b ) ∈ U , (21) \widehat{f}_n(\tau,b)\geq f(\tau,b)-\epsilon^2\geq\frac{1}{2}\|\mu_*\|_K^2-3\epsilon^2=:d_\epsilon,\qquad\text{for all }(\tau,b)\in U, \tag*{(21)} f n ( τ , b ) ≥ f ( τ , b ) − ϵ 2 ≥ 2 1 ∥ μ ∗ ∥ K 2 − 3 ϵ 2 =: d ϵ , for all ( τ , b ) ∈ U , (21)
where d ϵ > 0 d_\epsilon>0 d ϵ > 0 can be achieved by taking ϵ \epsilon ϵ small enough. In this case, the plug-in log-likelihood for p ϵ p_\epsilon p ϵ and ( τ , b ) ∈ U (\tau,b)\in U ( τ , b ) ∈ U becomes
log L ^ ( X 1 : n ∣ p ϵ , τ , b ) = n μ ∗ ( τ ) ′ b − n 2 b ′ K ^ n , τ b + n Z τ ′ b = n f ^ n ( τ , b ) + n Z τ ′ b , (22) \log\widehat{L}(X_{1:n}\mid p_\epsilon,\tau,b)=n\mu_*(\tau)'b-\frac{n}{2}b'\widehat{K}_{n,\tau}b+\sqrt{n}Z_\tau'b=n\widehat{f}_n(\tau,b)+\sqrt{n}Z_\tau'b, \tag*{(22)} log L ( X 1 : n ∣ p ϵ , τ , b ) = n μ ∗ ( τ ) ′ b − 2 n b ′ K n , τ b + n Z τ ′ b = n f n ( τ , b ) + n Z τ ′ b , (22)
where Z τ = 1 n ( S n ( τ ) − n μ ∗ ( τ ) ) Z_\tau=\frac{1}{\sqrt{n}}(\mathcal{S}_n(\tau)-n\mu_*(\tau)) Z τ = n 1 ( S n ( τ ) − n μ ∗ ( τ )) . Moreover, recall that by Cauchy–Schwarz we have
n Z τ ′ b ≥ − n B sup τ ∈ U 1 ∥ Z τ ∥ . (23) \sqrt{n}Z_\tau'b\geq-\sqrt{n}B\sup_{\tau\in U_1}\|Z_\tau\|. \tag*{(23)} n Z τ ′ b ≥ − n B τ ∈ U 1 sup ∥ Z τ ∥. (23)
On G n G_n G n , restricting the domain of integration and using (21), (22) and (23) produces the bound
m ^ 1 ( X 1 : n ) ≥ Π ( p ϵ ) ∫ U 1 ∫ U 2 N p ϵ ( b ∣ 0 , η 2 I p ϵ ) exp { n f ^ n ( τ , b ) + n Z τ ′ b } Π ( τ ∣ p ϵ ) d b d τ ≥ D exp { n d ϵ − n B ⋅ sup τ ∈ U 1 ∥ Z τ ∥ } . (24) \begin{aligned}
\widehat{m}_1(X_{1:n})\geq\Pi(p_\epsilon)\int_{U_1}\int_{U_2}\mathcal{N}_{p_\epsilon}(b\mid0,\eta^2I_{p_\epsilon})\exp\left\{n\widehat{f}_n(\tau,b)+\sqrt{n}Z_\tau'b\right\}\Pi(\tau\mid p_\epsilon)\,db\,d\tau\\
&\geq D\exp\left\{nd_\epsilon-\sqrt{n}B\cdot\sup_{\tau\in U_1}\|Z_\tau\|\right\}. \tag*{(24)}
\end{aligned} m 1 ( X 1 : n ) ≥ Π ( p ϵ ) ∫ U 1 ∫ U 2 N p ϵ ( b ∣ 0 , η 2 I p ϵ ) exp { n f n ( τ , b ) + n Z τ ′ b } Π ( τ ∣ p ϵ ) d b d τ ≥ D exp { n d ϵ − n B ⋅ τ ∈ U 1 sup ∥ Z τ ∥ } . (24)
where D = Π ( p ε ) Π τ ( U 1 ∣ p ε ) Π s l a b ( U 2 ∣ p ε ) > 0 D = \Pi(p_\varepsilon)\Pi_\tau(U_1 \mid p_\varepsilon)\Pi^{\mathrm{slab}}(U_2 \mid p_\varepsilon) > 0 D = Π ( p ε ) Π τ ( U 1 ∣ p ε ) Π slab ( U 2 ∣ p ε ) > 0 by assumption. Now, since Z τ ∼ N p ε ( 0 , K τ ) Z_\tau\sim\mathcal{N}_{p_\varepsilon}(0,K_\tau) Z τ ∼ N p ε ( 0 , K τ ) under H 1 H_1 H 1 , we already saw in the proof of Theorem 4 that for any δ > 0 \delta> 0 δ > 0 there exists M > 0 M > 0 M > 0 such that the event
H M = { B ⋅ sup τ ∈ U 1 ∥ Z τ ∥ ≤ M } H_M = \left\{B \cdot\sup_{\tau\in U_1} \lVert Z_\tau\rVert\le M\right\} H M = { B ⋅ τ ∈ U 1 sup ∥ Z τ ∥ ≤ M }
satisfies P μ ∗ ( H M c ) < δ / 2 \mathbb{P}_{\mu^*}(H_M^c) < \delta/2 P μ ∗ ( H M c ) < δ /2 . Thus, we have the inequality m ^ 1 ( X 1 : n ) ≥ D exp { n d ε − n M } \widehat{m}_1(X_{1:n}) \ge D\exp\{nd_\varepsilon-\sqrt{n}M\} m 1 ( X 1 : n ) ≥ D exp { n d ε − n M } on G n ∩ H M G_n \cap H_M G n ∩ H M by (24). Since n d ε / ( 1 + ε ) nd_\varepsilon/(1+\varepsilon) n d ε / ( 1 + ε ) grows slower than n d ε − n M nd_\varepsilon-\sqrt{n}M n d ε − n M as n → ∞ n \to\infty n → ∞ , for sufficiently large n n n we obtain m ^ 1 ( X 1 : n ) ≥ D exp { n d ε / ( 1 + ε ) } \widehat{m}_1(X_{1:n}) \ge D\exp\{nd_\varepsilon/(1+\varepsilon)\} m 1 ( X 1 : n ) ≥ D exp { n d ε / ( 1 + ε )} on G n ∩ H M G_n \cap H_M G n ∩ H M . Therefore,
Π ^ n ( H 0 ∣ X 1 : n ) = π 0 π 0 + ( 1 − π 0 ) m ^ 1 ( X 1 : n ) ≤ π 0 ( 1 − π 0 ) m ^ 1 ( X 1 : n ) ≤ D ~ exp { − n d ε 1 + ε } \widehat{\Pi}_n(H_0 \mid X_{1:n}) = \frac{\pi_0}{\pi_0+(1-\pi_0)\widehat{m}_1(X_{1:n})} \le\frac{\pi_0}{(1-\pi_0)\widehat{m}_1(X_{1:n})} \le\widetilde{D}\exp\left\{-\frac{nd_\varepsilon}{1+\varepsilon}\right\} Π n ( H 0 ∣ X 1 : n ) = π 0 + ( 1 − π 0 ) m 1 ( X 1 : n ) π 0 ≤ ( 1 − π 0 ) m 1 ( X 1 : n ) π 0 ≤ D exp { − 1 + ε n d ε }
on G n ∩ H M G_n \cap H_M G n ∩ H M , where D ~ = π 0 / ( ( 1 − π 0 ) D ) \widetilde{D}=\pi_0/((1-\pi_0)D) D = π 0 / (( 1 − π 0 ) D ) . Write P μ ∗ ( G n c ∪ H M c ) ≤ P μ ∗ ( G n c ) + P μ ∗ ( H M c ) \mathbb{P}_{\mu^*}(G_n^c \cup H_M^c) \le\mathbb{P}_{\mu^*}(G_n^c)+\mathbb{P}_{\mu^*}(H_M^c) P μ ∗ ( G n c ∪ H M c ) ≤ P μ ∗ ( G n c ) + P μ ∗ ( H M c ) , and note that the first term vanishes as n → ∞ n \to\infty n → ∞ , while the second is at most δ / 2 \delta/2 δ /2 . Then, for sufficiently large n n n we have proved that
P μ ∗ ( Π ^ n ( H 0 ∣ X 1 : n ) > D ~ exp { − n d ε 1 + ε } ) < δ , \mathbb{P}_{\mu^*}\left(\widehat{\Pi}_n(H_0 \mid X_{1:n})>\widetilde{D}\exp\left\{-\frac{nd_\varepsilon}{1+\varepsilon}\right\}\right)<\delta, P μ ∗ ( Π n ( H 0 ∣ X 1 : n ) > D exp { − 1 + ε n d ε } ) < δ ,
so Π ^ n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − n d ε / ( 1 + ε ) ) \widehat{\Pi}_n(H_0 \mid X_{1:n})=O_{\mathbb{P}_{\mu^*}}(e^{-nd_\varepsilon/(1+\varepsilon)}) Π n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − n d ε / ( 1 + ε ) ) and, as before, lim ε → 0 d ε / ( 1 + ε ) = 1 2 ∥ μ ∗ ∥ K 2 \lim_{\varepsilon\to0}d_\varepsilon/(1+\varepsilon)=\frac{1}{2}\lVert\mu^*\rVert_K^2 lim ε → 0 d ε / ( 1 + ε ) = 2 1 ∥ μ ∗ ∥ K 2 . The proof of the second part of the theorem is almost identical, except that f ( τ , b ) f(\tau,b) f ( τ , b ) is lower bounded by c ε , ξ c_{\varepsilon,\xi} c ε , ξ as in the construction from the proof of Theorem 6 .
On Optimality of the Contraction Rates
We conclude with a proof of the information-theoretic optimality of the contraction rate in Theorem 4 . We will need the following lemma, which is just the standard fact that marginal likelihoods are densities with respect to the fixed reference measure. It follows directly from Fubini/Tonelli and the properties of Radon–Nikodym derivatives.
Lemma 12 For any ( p , τ ) ∈ N × T p (p,\tau)\in\mathbb{N}\times\mathcal{T}_p ( p , τ ) ∈ N × T p and every n ≥ 1 n\ge1 n ≥ 1 , we have E P 0 [ m s l a b ( X 1 : n ∣ p , τ ) ] = 1 \mathbb{E}_{P_0}[m_{\mathrm{slab}}(X_{1:n}\mid p,\tau)]=1 E P 0 [ m slab ( X 1 : n ∣ p , τ )] = 1 .
Proof of Proposition 11
Proof Suppose by contradiction that a faster rate holds, say Π n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − n ζ ) \Pi_n(H_0\mid X_{1:n})=O_{\mathbb{P}_{\mu^*}}(e^{-n\zeta}) Π n ( H 0 ∣ X 1 : n ) = O P μ ∗ ( e − n ζ ) for ζ > 1 2 ∥ μ ∗ ∥ K 2 \zeta>\frac{1}{2}\lVert\mu^*\rVert_K^2 ζ > 2 1 ∥ μ ∗ ∥ K 2 . By definition, for any 0 < ε < 1 / 2 0<\varepsilon<1/2 0 < ε < 1/2 there exists M > 0 M>0 M > 0 such that the region
R n = { X 1 : n : Π n ( H 0 ∣ X 1 : n ) ≤ M e − n ζ } R_n=\{X_{1:n}:\Pi_n(H_0\mid X_{1:n})\le Me^{-n\zeta}\} R n = { X 1 : n : Π n ( H 0 ∣ X 1 : n ) ≤ M e − n ζ }
satisfies P μ ∗ ( R n ) > 1 − ε \mathbb{P}_{\mu^*}(R_n)>1-\varepsilon P μ ∗ ( R n ) > 1 − ε for sufficiently large n n n . Then, reusing the notation m 1 ( X 1 : n ) m_1(X_{1:n}) m 1 ( X 1 : n ) from (10), on R n R_n R n we have
Π n ( H 0 ∣ X 1 : n ) = π 0 π 0 + ( 1 − π 0 ) m 1 ( X 1 : n ) ≤ M e − n ζ , \Pi_n(H_0\mid X_{1:n})=\frac{\pi_0}{\pi_0+(1-\pi_0)m_1(X_{1:n})}\le Me^{-n\zeta}, Π n ( H 0 ∣ X 1 : n ) = π 0 + ( 1 − π 0 ) m 1 ( X 1 : n ) π 0 ≤ M e − n ζ ,
and rearranging yields
π 0 ( 1 − M e − n ζ ) ≤ ( 1 − π 0 ) m 1 ( X 1 : n ) M e − n ζ . \pi_0(1-Me^{-n\zeta})\le(1-\pi_0)m_1(X_{1:n})Me^{-n\zeta}. π 0 ( 1 − M e − n ζ ) ≤ ( 1 − π 0 ) m 1 ( X 1 : n ) M e − n ζ .
For sufficiently large n n n we have 1 − M e − n ζ ≥ 1 / 2 1-Me^{-n\zeta}\ge1/2 1 − M e − n ζ ≥ 1/2 , so eventually we get
1 ≤ 2 M ( 1 − π 0 ) π 0 e − n ζ m 1 ( X 1 : n ) . 1\le\frac{2M(1-\pi_0)}{\pi_0}e^{-n\zeta}m_1(X_{1:n}). 1 ≤ π 0 2 M ( 1 − π 0 ) e − n ζ m 1 ( X 1 : n ) .
Integrating on R n R_n R n on both sides with respect to P 0 \mathbb{P}_0 P 0 and using the fact that m 1 ( X 1 : n ) m_1(X_{1:n}) m 1 ( X 1 : n ) is a valid marginal likelihood (it integrates to 1 under P 0 \mathbb{P}_0 P 0 over the whole space by Lemma 12), we have
P 0 ( R n ) ≤ 2 M ( 1 − π 0 ) π 0 e − n ζ ∫ R n m 1 ( X 1 : n ) d P 0 ≤ C e − n ζ for large n , (25) \mathbb{P}_0(R_n)\le\frac{2M(1-\pi_0)}{\pi_0}e^{-n\zeta}\int_{R_n}m_1(X_{1:n})\,\mathrm{d}\mathbb{P}_0\le Ce^{-n\zeta}\quad\text{for large }n, \tag*{(25)} P 0 ( R n ) ≤ π 0 2 M ( 1 − π 0 ) e − n ζ ∫ R n m 1 ( X 1 : n ) d P 0 ≤ C e − n ζ for large n , (25)
where C > 0 C>0 C > 0 is a constant. Now we construct a frequentist test ϕ n \phi_n ϕ n for the reverse hypotheses H ~ 0 : μ ≡ μ ∗ \widetilde{H}_0:\mu\equiv\mu_* H 0 : μ ≡ μ ∗ against H ~ 1 : μ ≡ 0 \widetilde{H}_1:\mu\equiv0 H 1 : μ ≡ 0 , given by ϕ n ( X 1 : n ) = 1 { X 1 : n ∈ R n c } \phi_n(X_{1:n})=1\{X_{1:n}\in R_n^c\} ϕ n ( X 1 : n ) = 1 { X 1 : n ∈ R n c } . In this case, according to (2) the Kullback–Leibler divergence from P μ ∗ \mathbb{P}_{\mu_*} P μ ∗ to P 0 \mathbb{P}_0 P 0 is
D K L ( P μ ∗ ∥ P 0 ) = E P μ ∗ [ log d P μ ∗ d P 0 ( X ) ] = E P μ ∗ [ ⟨ X , μ ∗ ⟩ K ] − 1 2 ∥ μ ∗ ∥ K 2 = 1 2 ∥ μ ∗ ∥ K 2 . D_{\mathrm{KL}}(\mathbb{P}_{\mu_*}\Vert\mathbb{P}_0)=\mathbb{E}_{\mathbb{P}_{\mu_*}}\left[\log\frac{\mathrm{d}\mathbb{P}_{\mu_*}}{\mathrm{d}\mathbb{P}_0}(X)\right]=\mathbb{E}_{\mathbb{P}_{\mu_*}}[\langle X,\mu_*\rangle_K]-\frac{1}{2}\|\mu_*\|_K^2=\frac{1}{2}\|\mu_*\|_K^2. D KL ( P μ ∗ ∥ P 0 ) = E P μ ∗ [ log d P 0 d P μ ∗ ( X ) ] = E P μ ∗ [⟨ X , μ ∗ ⟩ K ] − 2 1 ∥ μ ∗ ∥ K 2 = 2 1 ∥ μ ∗ ∥ K 2 .
where we used the equivalence E P μ ∗ [ ⟨ X , μ ∗ ⟩ K ] = ⟨ μ ∗ , μ ∗ ⟩ K = ∥ μ ∗ ∥ K 2 \mathbb{E}_{\mathbb{P}_{\mu_*}}[\langle X,\mu_*\rangle_K]=\langle\mu_*,\mu_*\rangle_K=\|\mu_*\|_K^2 E P μ ∗ [⟨ X , μ ∗ ⟩ K ] = ⟨ μ ∗ , μ ∗ ⟩ K = ∥ μ ∗ ∥ K 2 that stems from Loève’s isometry (Parzen, [50 ] ). For sufficiently large n n n , the type I error probability is bounded, since P μ ∗ ( ϕ n = 1 ) = P μ ∗ ( R n c ) < ϵ \mathbb{P}_{\mu_*}(\phi_n=1)=\mathbb{P}_{\mu_*}(R_n^c)<\epsilon P μ ∗ ( ϕ n = 1 ) = P μ ∗ ( R n c ) < ϵ . On the other hand, by (25) the type II error probability for large n n n is P 0 ( ϕ n = 0 ) = P 0 ( R n ) ≤ C e − n ζ \mathbb{P}_0(\phi_n=0)=\mathbb{P}_0(R_n)\le Ce^{-n\zeta} P 0 ( ϕ n = 0 ) = P 0 ( R n ) ≤ C e − n ζ , which decays exponentially with exponential constant greater than D K L ( P μ ∗ ∥ P 0 ) D_{\mathrm{KL}}(\mathbb{P}_{\mu_*}\Vert\mathbb{P}_0) D KL ( P μ ∗ ∥ P 0 ) , contradicting Chernoff–Stein.
Additional Information on Numerical Experiments
We provide a description of the comparison methods, a runtime comparison of our RKBT test, and some technical implementation details.
Description of Comparison Methods
The frequentist comparison methods were mostly described by Zhang [65 ] . We consider the pivotal test function Δ n ( s ) = n X ‾ n ( s ) \Delta_n(s)=\sqrt{n}\overline{X}_n(s) Δ n ( s ) = n X n ( s ) , which will be small when the null hypothesis is true. We also fix a significance level α ∈ ( 0 , 1 ) \alpha\in(0,1) α ∈ ( 0 , 1 ) and the discretized grid S = { s 1 , … , s g } S=\{s_1,\ldots,s_g\} S = { s 1 , … , s g } .
Pointwise t t t -Test
The first naive idea is to construct a pointwise t t t -test over all points on the grid, and then reject H 0 H_0 H 0 if any pointwise test rejects H 0 s : μ ( s ) = 0 H_{0s}:\mu(s)=0 H 0 s : μ ( s ) = 0 . The local test statistics are
z n ( s ) = Δ n ( s ) C ^ n ( s , s ) ∼ t n − 1 , s ∈ [ 0 , 1 ] . z_n(s)=\frac{\Delta_n(s)}{\sqrt{\widehat{C}_n(s,s)}}\sim t_{n-1},\qquad s\in[0,1]. z n ( s ) = C n ( s , s ) Δ n ( s ) ∼ t n − 1 , s ∈ [ 0 , 1 ] .
We use the Bonferroni correction on the p p p -values (Shaffer, [55 ] ) to produce a global test that accounts for the multiple comparisons problem and controls the probability of the so-called family-wise error rate (FWER), at the expense of decreased power. In particular, we reject H 0 H_0 H 0 whenever the p p p -value of at least one of the local tests is less than α / G \alpha/G α / G . While there are more sophisticated approaches to correct p p p -values (e.g. Cox and Lee, [12 ] ), we keep the simple Bonferroni method as a baseline.
L 2 L^2 L 2 -Norm Based Tests
We perform a global test based on the squared L 2 L^2 L 2 -norm ∥ ⋅ ∥ 2 \lVert\cdot\rVert_2 ∥ ⋅ ∥ 2 of the pivotal test function Δ n \Delta_n Δ n . The proposed test statistic is
T n = ∥ Δ n ∥ 2 2 = n ∫ 0 1 X ‾ n 2 ( s ) d s . (26) T_n=\lVert\Delta_n\rVert_2^2=n\int_0^1\overline{X}_n^2(s)\,ds. \tag*{(26)} T n = ∥ Δ n ∥ 2 2 = n ∫ 0 1 X n 2 ( s ) d s . (26)
Under H 0 H_0 H 0 and Gaussian data, T n T_n T n follows a χ 2 \chi^2 χ 2 -type mixture distribution. Using a Box-type approximation [7 ] , we have
T n ∼ γ χ d 2 approximately , where γ = Tr ( K ⊗ 2 ) Tr ( K ) and d = Tr 2 ( K ) Tr ( K ⊗ 2 ) , T_n\sim\gamma\chi_d^2\text{ approximately},\qquad\text{where }\gamma=\frac{\operatorname{Tr}(K^{\otimes2})}{\operatorname{Tr}(K)}\text{ and }d=\frac{\operatorname{Tr}^2(K)}{\operatorname{Tr}(K^{\otimes2})}, T n ∼ γ χ d 2 approximately , where γ = Tr ( K ) Tr ( K ⊗ 2 ) and d = Tr ( K ⊗ 2 ) Tr 2 ( K ) ,
with Tr ( K ⊗ 2 ) = ∫ 0 1 ∫ 0 1 K ( t , s ) 2 d t d s \operatorname{Tr}(K^{\otimes2})=\int_0^1\int_0^1K(t,s)^2\,dt\,ds Tr ( K ⊗ 2 ) = ∫ 0 1 ∫ 0 1 K ( t , s ) 2 d t d s . Since K K K is generally unknown, a common approach is to use the empirical covariance estimator C ^ n \widehat{C}_n C n to approximate γ \gamma γ and d d d , which leads to consistent estimators γ ^ \widehat{\gamma} γ and d ^ \widehat{d} d [65 Theorem 4.17] . The corresponding p p p -value for the test is given by P ( χ d ^ 2 ≥ T n / γ ^ ) P(\chi_{\widehat{d}}^2\ge T_n/\widehat{\gamma}) P ( χ d 2 ≥ T n / γ ) . In practice, we need to discretize the functional elements to compute the test statistic and p p p -value:
T n = n ∑ g = 1 G X ‾ n 2 ( s g ) , γ ^ ≈ Tr ( C ^ n 2 ) Tr ( C ^ n ) , d ^ ≈ Tr 2 ( C ^ n ) Tr ( C ^ n 2 ) . T_n=n\sum_{g=1}^{G}\overline{X}_n^2(s_g),\qquad\widehat{\gamma}\approx\frac{\operatorname{Tr}(\widehat{C}_n^2)}{\operatorname{Tr}(\widehat{C}_n)},\qquad\widehat{d}\approx\frac{\operatorname{Tr}^2(\widehat{C}_n)}{\operatorname{Tr}(\widehat{C}_n^2)}. T n = n g = 1 ∑ G X n 2 ( s g ) , γ ≈ Tr ( C n ) Tr ( C n 2 ) , d ≈ Tr ( C n 2 ) Tr 2 ( C n ) .
Note that the constant discretization step 1 / G 1/G 1/ G that would appear from approximating the integrals cancels out in the computations, so it can be omitted for simplicity.
Remark 13 If we use the improved estimator K ^ n O A S \widehat{K}_n^{OAS} K n O A S to approximate γ ^ \widehat{\gamma} γ and d ^ \widehat{d} d , the argument goes through unaffected: by Proposition 8 we have ∥ K ^ n O A S − K ∥ → 0 \lVert\widehat{K}_n^{OAS}-K\rVert\to0 ∥ K n O A S − K ∥ → 0 a.s., and hence the traces converge almost surely to the true value.
We can also consider a projection-based version of the L 2 L^2 L 2 test using functional principal component analysis (FPCA), which was explored for example by Horváth and Kokoszka [27 ] in a similar testing problem. Let λ 1 ≥ λ 2 ≥ ⋯ ≥ λ p > 0 \lambda_1\ge\lambda_2\ge\cdots\ge\lambda_p>0 λ 1 ≥ λ 2 ≥ ⋯ ≥ λ p > 0 be the p p p leading eigenvalues of the true covariance operator, with ϕ 1 , … , ϕ p \phi_1,\ldots,\phi_p ϕ 1 , … , ϕ p the corresponding eigenfunctions (up to a sign flip). Then, we can define a test statistic analogous to (26) but with the mean function projected on the space spanned by ϕ 1 , … , ϕ p \phi_1,\ldots,\phi_p ϕ 1 , … , ϕ p . Write the FPCA scores of the sample mean as
ξ ˉ j = ∫ 0 1 X ‾ n ( s ) ϕ j ( s ) d s , j = 1 , … , p , (27) \bar{\xi}_j=\int_0^1\overline{X}_n(s)\phi_j(s)\,ds,\qquad j=1,\ldots,p, \tag*{(27)} ξ ˉ j = ∫ 0 1 X n ( s ) ϕ j ( s ) d s , j = 1 , … , p , (27)
and consider the statistic
T n , p = n ∑ j = 1 p ξ ˉ j 2 λ j , (28) T_{n,p}=n\sum_{j=1}^{p}\frac{\bar{\xi}_j^2}{\lambda_j}, \tag*{(28)} T n , p = n j = 1 ∑ p λ j ξ ˉ j 2 , (28)
where normalization by the eigenvalues is introduced to simplify the expression of the null distribution. Indeed, by standard FPCA theory, under H 0 H_0 H 0 and the Gaussian assumption we have T n , p ∼ χ p 2 T_{n,p}\sim\chi_p^2 T n , p ∼ χ p 2 . Of course, we rarely have access to the true K K K , so we construct estimates { λ ^ j } \{\hat{\lambda}_j\} { λ ^ j } and { ϕ ^ j } \{\hat{\phi}_j\} { ϕ ^ j } for the eigenvalues and eigenfunctions via the (truncated) spectral decomposition of the empirical covariance C ^ n \hat{C}_n C ^ n , and then compute an approximate T ^ n , p \hat{T}_{n,p} T ^ n , p plugging in the estimated values into (27) and (28). Under mild assumptions (finite fourth moments, distinctness of the true eigenvalues), it can be shown that T ^ n , p → d χ p 2 \hat{T}_{n,p} \xrightarrow{d} \chi_p^2 T ^ n , p d χ p 2 as n → ∞ n \to\infty n → ∞ (Horváth and Kokoszka, [27 ] ), so asymptotically the p p p -value for the test is P ( χ p 2 ≥ T ^ n , p ) \mathbb{P}(\chi_p^2 \geq\hat{T}_{n,p}) P ( χ p 2 ≥ T ^ n , p ) . As we said before, in practice we compute all quantities involved in the discretized grid S S S :
λ ^ j ≈ l ^ j , ϕ ^ j ≈ v ^ j = ( v ^ j 1 , … , v ^ j G ) ′ , T ^ n , p ≈ n ∑ j = 1 p ( ∑ g = 1 G X ‾ n ( s g ) v ^ j g ) 2 l ^ j . \hat{\lambda}_j \approx\hat{l}_j,\qquad\hat{\phi}_j \approx\hat{\mathbf{v}}_j = (\hat{v}_{j1},\ldots,\hat{v}_{jG})^\prime,\qquad\hat{T}_{n,p} \approx n \sum_{j=1}^{p}\frac{\left(\sum_{g=1}^{G}\overline{X}_n(s_g)\hat{v}_{jg}\right)^2}{\hat{l}_j}. λ ^ j ≈ l ^ j , ϕ ^ j ≈ v ^ j = ( v ^ j 1 , … , v ^ j G ) ′ , T ^ n , p ≈ n j = 1 ∑ p l ^ j ( ∑ g = 1 G X n ( s g ) v ^ j g ) 2 .
where { l ^ j , v ^ j } \{\hat{l}_j,\hat{\mathbf{v}}_j\} { l ^ j , v ^ j } are the eigenvalues and (normalized) eigenvectors of the G × G G \times G G × G empirical covariance matrix C ^ n \hat{C}_n C ^ n . We could also use the regularized version K ^ n O A S \hat{K}^{\mathrm{OAS}}_n K ^ n OAS to compute the eigendecomposition, and even though we did not explore the theoretical guarantees in this case, it is likely that the eigenvalues and eigenvectors of the OAS estimator constitute sufficiently good approximations for our purposes.
The only missing aspect is the question of how many components to retain. We follow the simple approach proposed by Ramsay and Silverman [51 ] , who suggest selecting p p p so that the resulting functional principal components cumulatively explain a fixed large percentage of the variance (e.g. 90%).
F-Type Test
The previous L 2 L^2 L 2 -based tests do not take into account the variation of the covariance function. Under H 0 H_0 H 0 and Gaussian data, we have E ∥ Δ n ∥ 2 2 = Tr ( K ) \mathbb{E}\lVert\Delta_n\rVert_2^2 = \operatorname{Tr}(K) E ∥ Δ n ∥ 2 2 = Tr ( K ) and E [ Tr ( C ^ n ) ] = Tr ( K ) \mathbb{E}[\operatorname{Tr}(\hat{C}_n)] = \operatorname{Tr}(K) E [ Tr ( C ^ n )] = Tr ( K ) , so we can consider the statistic
F n = ∥ Δ n ∥ 2 2 Tr ( C ^ n ) ≈ n ∑ g = 1 G X ‾ n 2 ( s g ) Tr ( C ^ n ) . F_n = \frac{\lVert\Delta_n\rVert_2^2}{\operatorname{Tr}(\hat{C}_n)} \approx\frac{n\sum_{g=1}^{G}\overline{X}_n^2(s_g)}{\operatorname{Tr}(\hat{C}_n)}. F n = Tr ( C ^ n ) ∥ Δ n ∥ 2 2 ≈ Tr ( C ^ n ) n ∑ g = 1 G X n 2 ( s g ) .
whose null distribution is shown to be an F F F -type mixture. It can again be approximated by a two-cumulant method (Zhang, [65 ] ), so that F n ∼ F d ^ , ( n − 1 ) d ^ F_n \sim F_{\hat{d},(n-1)\hat{d}} F n ∼ F d ^ , ( n − 1 ) d ^ approximately, and the approximate p p p -value for the test is P ( F d ^ , ( n − 1 ) d ^ ≥ F n ) \mathbb{P}(F_{\hat{d},(n-1)\hat{d}} \geq F_n) P ( F d ^ , ( n − 1 ) d ^ ≥ F n ) . This method works for the OAS estimator as well, since Tr ( K ^ n O A S ) = Tr ( K ^ n ) \operatorname{Tr}(\hat{K}^{\mathrm{OAS}}_n) = \operatorname{Tr}(\hat{K}_n) Tr ( K ^ n OAS ) = Tr ( K ^ n ) .
Bootstrap Procedures
Both the L 2 L^2 L 2 -based tests and the F F F -type test rely on asymptotic approximations, so their performance can deteriorate when the sample size n n n is small. For such cases we can resort to a nonparametric bootstrap scheme to approximate the null distribution of the statistics. In particular, we consider the following simple algorithm:
Draw a bootstrap sample X 1 ∗ , … , X n ∗ X_1^*,\ldots,X_n^* X 1 ∗ , … , X n ∗ from X 1 , … , X n X_1,\ldots,X_n X 1 , … , X n (with replacement).
Compute the quantities X ‾ n ∗ \overline{X}_n^* X n ∗ and C ^ n ∗ \hat{C}_n^* C ^ n ∗ from the bootstrap sample.
Construct the bootstrap statistics T n ∗ = ∥ n ( X ‾ n ∗ ( s ) − X ‾ ( s ) ) ∥ 2 2 T_n^* = \lVert\sqrt{n}(\overline{X}_n^*(s)-\overline{X}(s))\rVert_2^2 T n ∗ = ∥ n ( X n ∗ ( s ) − X ( s )) ∥ 2 2 and F n ∗ = T n ∗ / Tr ( C ^ n ∗ ) F_n^* = T_n^*/\operatorname{Tr}(\hat{C}_n^*) F n ∗ = T n ∗ / Tr ( C ^ n ∗ ) .
Repeat the process many times to obtain R R R bootstrap statistics, and compute the bootstrap p p p -value as the proportion of bootstrap statistics that exceed the original statistic.
In particular, the bootstrap p p p -values are
p ∗ ( T n ) = 1 + # { T n ∗ ≥ T n } R + 1 , p ∗ ( F n ) = 1 + # { F n ∗ ≥ F n } R + 1 , p^*(T_n) = \frac{1 + \#\{T_n^* \ge T_n\}}{R+1}, \qquad p^*(F_n) = \frac{1 + \#\{F_n^* \ge F_n\}}{R+1}, p ∗ ( T n ) = R + 1 1 + # { T n ∗ ≥ T n } , p ∗ ( F n ) = R + 1 1 + # { F n ∗ ≥ F n } ,
where the original statistic is added as a positive instance to avoid the case of p ∗ = 0 p^* = 0 p ∗ = 0 (see Davison and Hinkley [17 ] . Note that the same procedure can be applied to the L 2 L^2 L 2 -FPCA test, recomputing the eigendecomposition of the bootstrap empirical covariance matrix C ^ n ∗ \widehat{\mathbf{C}}_n^* C n ∗ each time. In our implementation, we activate this bootstrap procedure with R = 5000 R = 5000 R = 5000 whenever n ≤ 50 n \le50 n ≤ 50 .
Bayesian Functional Test with FPCA
Consider for all i = 1 , … , n i = 1,\ldots,n i = 1 , … , n the discretized vector X i = ( X i ( s 1 ) , … , X i ( s G ) ) ′ \mathbf{X}_i = (X_i(s_1),\ldots,X_i(s_G))^\prime X i = ( X i ( s 1 ) , … , X i ( s G ) ) ′ , and place a multivariate normal model on these finite-dimensional observations, that is,
X i ∣ μ , K ∼ N G ( μ , K ) , i = 1 , … , n , \mathbf{X}_i \mid\boldsymbol{\mu}, \mathbf{K} \sim\mathcal{N}_G(\boldsymbol{\mu}, \mathbf{K}), \qquad i = 1,\ldots,n, X i ∣ μ , K ∼ N G ( μ , K ) , i = 1 , … , n ,
where μ = ( μ ( s 1 ) , … , μ ( s G ) ) ′ \boldsymbol{\mu} = (\mu(s_1),\ldots,\mu(s_G))^\prime μ = ( μ ( s 1 ) , … , μ ( s G ) ) ′ and K \mathbf{K} K is the G × G G \times G G × G discretized covariance on the grid. To test H 0 : μ = 0 H_0 : \boldsymbol{\mu} = 0 H 0 : μ = 0 against H 1 : μ ≠ 0 H_1 : \boldsymbol{\mu} \ne0 H 1 : μ = 0 , we place a g g g -prior on the mean under H 1 H_1 H 1 , i.e.,
μ ∣ g , K ∼ N G ( 0 , g K ) , \boldsymbol{\mu} \mid g, \mathbf{K} \sim\mathcal{N}_G(0, g\mathbf{K}), μ ∣ g , K ∼ N G ( 0 , g K ) ,
where g > 0 g > 0 g > 0 is a scalar hyperparameter. This prior, introduced by Zellner [63 ] , encodes the belief that the mean function varies along the same directions as the data covariance, scaled by the factor g g g . Under this conjugate model, the Bayes factor in favor of the alternative is available in closed form after integrating out μ \boldsymbol{\mu} μ (for a similar computation, see Liang et al. [41 ] ):
log B F 10 = − G 2 log ( 1 + n g ) + n 2 g 2 ( 1 + n g ) Q n , (29) \log\mathrm{BF}_{10} = -\frac{G}{2}\log(1+ng) + \frac{n^2g}{2(1+ng)}Q_n, \tag*{(29)} log BF 10 = − 2 G log ( 1 + n g ) + 2 ( 1 + n g ) n 2 g Q n , (29)
where Q n = X ‾ n ′ K − 1 X ‾ n Q_n = \overline{\mathbf{X}}_n^\prime\mathbf{K}^{-1}\overline{\mathbf{X}}_n Q n = X n ′ K − 1 X n , X ‾ n = 1 n ∑ i = 1 n X i \overline{\mathbf{X}}_n = \frac{1}{n}\sum_{i=1}^{n}\mathbf{X}_i X n = n 1 ∑ i = 1 n X i is the discretized sample mean, and we have supposed for simplicity that π 0 = 1 − π 0 = 1 / 2 \pi_0 = 1-\pi_0 = 1/2 π 0 = 1 − π 0 = 1/2 .
In practice, we compute the Bayes factor using the plug-in estimators C ^ n \widehat{\mathbf{C}}_n C n or K ^ n O A S \widehat{\mathbf{K}}_n^{\mathrm{OAS}} K n OAS of the covariance matrix. However, applying (29) directly on the full G G G -dimensional discretized data presents two noticeable difficulties:
When n < G n < G n < G (the typical FDA setting), the empirical covariance matrix C ^ n \widehat{\mathbf{C}}_n C n is rank-deficient, so C ^ n − 1 \widehat{\mathbf{C}}_n^{-1} C n − 1 and the corresponding plug-in quadratic form Q ^ n \widehat{Q}_n Q n do not exist. Even with regularization (e.g. by OAS or adding a small noise to the diagonal), the resulting Q ^ n \widehat{Q}_n Q n can be numerically unstable and a poor estimate.
The Bayes factor contains a penalty term that grows linearly with G G G . This penalty can become large and drown out the signal in Q n Q_n Q n , driving B F 10 \mathrm{BF}_{10} BF 10 towards H 0 H_0 H 0 regardless of the data. This phenomenon is known as Lindley’s paradox (Lindley [42 ] ).
From a functional perspective, both problems are organically resolved by projecting onto the top p ≪ G p \ll G p ≪ G functional principal components, retaining the signal-carrying directions and discarding the noisy ones. As before, consider the eigendecomposition
K = V Σ V ′ , V = [ v 1 ∣ ⋯ ∣ v p ] , Σ = diag ( ℓ 1 , … , ℓ p ) , \mathbf{K} = \mathbf{V}\mathbf{\Sigma}\mathbf{V}^\prime, \qquad\mathbf{V} = [\mathbf{v}_1|\cdots|\mathbf{v}_p], \qquad\mathbf{\Sigma} = \operatorname{diag}(\ell_1,\ldots,\ell_p), K = VΣ V ′ , V = [ v 1 ∣ ⋯ ∣ v p ] , Σ = diag ( ℓ 1 , … , ℓ p ) ,
where l 1 ≥ ⋯ ≥ l p > 0 l_1 \ge\cdots\ge l_p > 0 l 1 ≥ ⋯ ≥ l p > 0 are the leading eigenvalues of K \mathbf{K} K and v 1 , … , v p \mathbf{v}_1,\ldots,\mathbf{v}_p v 1 , … , v p are the corresponding eigenvectors. We can transform the data onto the p p p -dimensional score space, defining the FPCA scores as
ξ i = V ′ X i , i = 1 , … , n . \boldsymbol{\xi}_i = \mathbf{V}^{\prime}\mathbf{X}_i,\quad i=1,\ldots,n. ξ i = V ′ X i , i = 1 , … , n .
In score space, the null hypothesis can be expressed as H 0 : μ ~ = 0 H_0:\widetilde{\boldsymbol{\mu}}=0 H 0 : μ = 0 , where μ ~ = ( μ ~ 1 , … , μ ~ p ) ′ \widetilde{\boldsymbol{\mu}}=(\widetilde{\mu}_1,\ldots,\widetilde{\mu}_p)^{\prime} μ = ( μ 1 , … , μ p ) ′ and μ ~ j = μ ′ v j \widetilde{\mu}_j=\boldsymbol{\mu}^{\prime}\mathbf{v}_j μ j = μ ′ v j is the projection of the true mean vector onto the j j j -th eigenvector. In this way, the model becomes
ξ i ∣ μ ~ , Σ ∼ N p ( μ ~ , Σ ) , i = 1 , … , n . \boldsymbol{\xi}_i\mid\widetilde{\boldsymbol{\mu}},\boldsymbol{\Sigma}\sim N_p(\widetilde{\boldsymbol{\mu}},\boldsymbol{\Sigma}),\quad i=1,\ldots,n. ξ i ∣ μ , Σ ∼ N p ( μ , Σ ) , i = 1 , … , n .
and the corresponding g g g -prior under H 1 H_1 H 1 is
μ ~ ∣ g , Σ ∼ N p ( 0 , g Σ ) . \widetilde{\boldsymbol{\mu}}\mid g,\boldsymbol{\Sigma}\sim N_p(0,g\boldsymbol{\Sigma}). μ ∣ g , Σ ∼ N p ( 0 , g Σ ) .
We can derive the Bayes factor for this reduced model in the same way as we did above for the fully discretized model (in fact now it is easier because the prior factorizes in independent components), obtaining
log BF 10 F P C A = − p 2 log ( 1 + n g ) + n 2 g 2 ( 1 + n g ) Q n , p , (30) \log\operatorname{BF}_{10}^{\mathrm{FPCA}}=-\frac{p}{2}\log(1+ng)+\frac{n^2g}{2(1+ng)}Q_{n,p}, \tag*{(30)} log BF 10 FPCA = − 2 p log ( 1 + n g ) + 2 ( 1 + n g ) n 2 g Q n , p , (30)
where
Q n , p = ∑ j = 1 p ( X ‾ n ′ v j ) 2 l j . Q_{n,p}=\sum_{j=1}^{p}\frac{(\overline{\mathbf{X}}_n^{\prime}\mathbf{v}_j)^2}{l_j}. Q n , p = j = 1 ∑ p l j ( X n ′ v j ) 2 .
Observe that Q n , p Q_{n,p} Q n , p is essentially a discretized and rescaled version of the statistic T n , p T_{n,p} T n , p in the L 2 L^2 L 2 -based FPCA test, defined in (28) . Naturally, in the actual implementation we approximate the eigenvalues and eigenvectors via the eigendecomposition of the empirical covariance matrix C ^ n \widehat{\mathbf{C}}_n C n or its regularized version, obtaining empirical estimates { l ^ j , v ^ j } \{\widehat{l}_j,\widehat{\mathbf{v}}_j\} { l j , v j } that we can substitute into the formulas above.
We still need to choose a suitable value for the hyperparameter g g g . It controls the prior spread under H 1 H_1 H 1 : a small g g g concentrates the prior near the null, while a large g g g makes it diffuse. A fixed choice (e.g. g = 1 g=1 g = 1 ) is common, but data-driven selection typically performs better. As mentioned by Liang et al. [41 ] , we can compute an empirical Bayes estimate of g g g by maximizing the marginal likelihood under H 1 H_1 H 1 . In particular, consider
g n ∗ = argmax g BF 10 F P C A ( g ) = Q n , p p − 1 n . g_n^*=\underset{g}{\operatorname{argmax}}\ \operatorname{BF}_{10}^{\mathrm{FPCA}}(g)=\frac{Q_{n,p}}{p}-\frac{1}{n}. g n ∗ = g argmax BF 10 FPCA ( g ) = p Q n , p − n 1 .
which is obtained by differentiating (30) with respect to g g g and setting the derivative to zero. Then, the estimated value for g g g is g ^ n = max { δ , g n ∗ } \widehat{g}_n=\max\{\delta,g_n^*\} g n = max { δ , g n ∗ } , where δ > 0 \delta>0 δ > 0 is a small constant to avoid degeneracy at the boundary { g = 0 } \{g=0\} { g = 0 } (in the experiments we used δ = 10 − 3 \delta=10^{-3} δ = 1 0 − 3 ).
Note that this FPCA-based Bayesian method is simpler than the full R}JMCMC procedure described in § 2 , and provides an exact Bayes factor without the need to approximate the posterior. However, it is not as flexible as the RKHS-based approach, and it seems to perform a bit worse in practice.
Practical Notes for Implementation
We comment briefly on a few implementation suggestions aimed at improving the computational efficiency of the tests:
Use Cholesky decompositions to avoid computing expensive matrix inverses.
Use log-formulas for quantities like m s l a b ( X 1 : n ∣ p , τ ) m_{\mathrm{slab}}(X_{1:n}\mid p,\tau) m slab ( X 1 : n ∣ p , τ ) , and employ the built-in Python functions logaddexp(x,y)=log(exp(x)+exp(y)) and log1p(x)=log(1+x) to compute the log-marginal likelihood, the Bayes factor and other expressions.
Store values such as log m s l a b ( X 1 : n ∣ p ( r ) , τ ( r ) ) \log m_{\mathrm{slab}}(X_{1:n}\mid p^{(r)},\tau^{(r)}) log m slab ( X 1 : n ∣ p ( r ) , τ ( r ) ) or ( Λ τ − 1 ) ( r ) (\Lambda_{\tau}^{-1})^{(r)} ( Λ τ − 1 ) ( r ) per RJMCMC step to reuse them in later computations.
If needed, use a stable sigmoid to compute the posterior probability from the log-Bayes factor: if ℓ = log ( 1 − π 0 π 0 B F 10 ) ≥ 0 \ell=\log\left(\frac{1-\pi_0}{\pi_0}\mathrm{BF}_{10}\right)\ge0 ℓ = log ( π 0 1 − π 0 BF 10 ) ≥ 0 , then Π ( H 1 ∣ X ) = 1 / ( 1 + e − ℓ ) \Pi(H_1\mid X)=1/(1+e^{-\ell}) Π ( H 1 ∣ X ) = 1/ ( 1 + e − ℓ ) ; otherwise, Π ( H 1 ∣ X ) = e ℓ / ( 1 + e ℓ ) \Pi(H_1\mid X)=e^\ell/(1+e^\ell) Π ( H 1 ∣ X ) = e ℓ / ( 1 + e ℓ ) .
Runtime Comparison
As we mentioned before, our test is slower than the competitors due to the RJMCMC sampling, but it still runs in acceptable time under the experimental conditions in § 4 (see Figure 2 ). The L 2 L^2 L 2 -FPCA method is also slow because it requires recomputing the FPCA decomposition for each bootstrap sample. The rest of the methods are almost instantaneous, as they do not perform intensive computation.
Figure 2. Mean runtime of all tests for the synthetic data sets (log-scale x-axis).
Experimental Setup
All experiments were run on a Linux laptop with an AMD Ryzen 7 6800HS CPU and 16 GB of RAM. The Python code for reproducing the experiments is publicly available online at https://github.com/antcc/rk-bt-jump .