On Average-Case Error Bounds for Kernel-Based Bayesian Quadrature

Abstract: In this paper, we study error bounds for {\em Bayesian quadrature} (BQ), with an emphasis on noisy settings, randomized algorithms, and average-case performance measures. We seek to approximate the integral of functions in a {\em Reproducing Kernel Hilbert Space} (RKHS), particularly focusing on the Matérn-$\nu$ and squared exponential (SE) kernels, with samples from the function potentially being corrupted by Gaussian noise. We provide a two-step meta-algorithm that serves as a general tool for relating the average-case quadrature error with the $L^2$-function approximation error. When specialized to the Matérn kernel, we recover an existing near-optimal error rate while avoiding the existing method of repeatedly sampling points. When specialized to other settings, we obtain new average-case results for settings including the SE kernel with noise and the Matérn kernel with misspecification. Finally, we present algorithm-independent lower bounds that have greater generality and/or give distinct proofs compared to existing ones.

\section{Equivalence Between Sobolev Space and Mat\'ern RKHS} \label{sec:sobolev}

Here we state a known result that characterizes the equivalence between Sobolev space and RKHS of Mat\'ern kernels.  Recall that the relevant definitions for Sobolev functions are given in \eqref{eq:sobolev}--\eqref{eq:sobnorm}.

\begin{lem} \label{lem:Sobolev-Matern-RKHS-equivalence}
   {\em (Sobolev Space \& RKHS of Mat\'ern kernels \citep[Example 2.6]{Kan18})}
   Let $\mathcal{H}$ be the RKHS fo the Mat\'ern-$\nu$ kernel on $D=[0,1]^d$ (with any fixed positive length scale), and suppose that $s=\nu+d/2$ is an integer.  Then, the RKHS is norm-equivalent to the Sobolev space $W^s_2$. That is, $\mathcal{H}=W^s_2$ as a set of functions, and there exist constants $c_1,c_2>0$ such that for any $f\in\mathcal{H}$ (or equivalently, $f\in W^s_2$) we have
   \begin{equation}
       c_1\lVert f \rVert_{W^s_2} \leq \lVert f \rVert_{\mathcal{H}} \leq c_2\lVert f \rVert_{W^s_2}.
   \end{equation}
\end{lem}

In other words, if $s=\nu+d/2$ is an integer, the Sobolev norm and the RKHS norm are within a constant factor of each other.

\section{Proof of Theorem \ref{thm:noiseless_lower} (Noiseless Lower Bound)}\label{app:noiseless_lower}

While Theorem \ref{thm:noiseless_lower} is known, it is useful to present a self-contained proof for completeness, to set the stage for our analysis of the noisy setting.  We generally follow the analysis of \cite{Nov06}, while adapting the notation to match ours, and making some minor adjustments in the analysis.

\subsection{Function Class Construction} \label{sec:matern_class}

We first describe a bounded-support class of functions consisting of multiple bumps. Recall Lemma \ref{lem:bounded_bump}, and let $g_0(\mathbf{x}) = \frac{\epsilon}{h(\boldsymbol{0})}h_0(\frac{2\mathbf{x}}{w})$ be the re-scaled bump function with values in $[0, \epsilon]$ and radius $\frac{w}{2}$ (i.e., diameter $w$).  For suitably-chosen $M$, we consider $M$ such bumps with disjoint supports by shifting, and accordingly consider $2^M$ functions, one for each possible sign pattern of the bumps.  Mathematically, all functions of the form  $f(\mathbf{x}):=\sum_{i=1}^{M}\delta_i g_i(\mathbf{x})$ are contained in $\Fc_{\mathrm{bump}}\subset\mathcal{F}_k(B)$, where $\delta_i\in\{+1, -1\}$ and $g_i(\mathbf{x})$ is the shifted version of $g_0(\mathbf{x})$.  Since the bumps form a $d$-dimensional grid of step size $w$ in each dimension and the domain is $D = [0,1]^d$, we have
\begin{equation}
    M=\Big\lfloor \frac{1}{w}\Big\rfloor^d. \label{eq:choice_M}
\end{equation}
In fact, since the bumps have spherical support instead of rectangular, we could fit more of them into $[0,1]^d$, but doing so would only impact the constant factors, which we do not seek to optimize.

A 1D example of $f\in\mathcal{F}_{\rm bump}$ is illustrated in Figure \ref{fig:f_matern_1d}.
\begin{figure}[h!]
 \begin{centering}
 \includegraphics[width=0.5\textwidth]{./figs/lb-1d-demo.pdf}
 \par
 \end{centering}
 \caption{1D illustration of a function in the restricted function class $\mathcal{F}_{\rm bump}$. \label{fig:f_matern_1d}}
\end{figure}

Letting $I_0:=\int_{\|\mathbf{x}\|\le \frac{w}{2}} g_0(\mathbf{x})d\mathbf{x} $ denote the integral of $g_0$, we have
\begin{align}
   I_0 \ge \Omega(w^d \epsilon), \label{eq:int_lower}
\end{align}
which follows from the fact that the integral of $h_0$ is constant, the vertical scaling shrinks the integral by $\epsilon$, and the horizontal scaling shrinks the integral by $\Theta(w^d)$.

To evaluate the RKHS norm of each $f$, we use the equivalence of the RKHS norm of $f$ and the Sobolev norm, as stated in Lemma \ref{lem:Sobolev-Matern-RKHS-equivalence}.   Since each $f\in\mathcal{F}_{\rm bump}$ is a sum of $M$ disjoint-support functions, we can define these disjoint regions as $D_1,\dotsc,D_M$ and study \eqref{eq:sobnorm} as follows:
\begin{align}
    \|f\|_{W_2^s} &=  \Big( \sum_{|\alpha| \le s} \|\partial^{\alpha}f(\mathbf{x})\|_{L^2}^2 \Big)^{1/2} \nonumber\\
    & = \Big( \sum_{|\alpha| \le s} \big\|\partial^{\alpha} \sum_{i=1}^{M}\delta_i g_i(\mathbf{x})\big\|_{L^2}^2 \Big)^{1/2} \nonumber\\
    & = \Big( \sum_{|\alpha| \le s} \big\|\sum_{i=1}^{M}\delta_i \partial^{\alpha} g_i(\mathbf{x})\big\|_{L^2}^2 \Big)^{1/2} \nonumber\\
    & = \Big( \sum_{|\alpha| \le s} \int_{D} \Big|\sum_{i=1}^{M} \delta_i\partial^{\alpha} g_i(\mathbf{x})\Big|^2 d\mathbf{x} \Big)^{1/2} \nonumber\\
    & = \Big( \sum_{|\alpha| \le s} \sum_{i=1}^{M} \int_{D_i} \big| \partial^{\alpha} g_i(\mathbf{x})\big |^2 d\mathbf{x} \Big)^{1/2} \label{eq:disjoint_sum}\\
    & = \Big( \sum_{i=1}^{M} \|g_i(\mathbf{x})\|_{W_2^s}^2 \Big)^{1/2} \nonumber\\
    & = \sqrt{M}\|g_0\|_{W_2^s}, \label{eq:rkhs_bound}
\end{align}
where \eqref{eq:disjoint_sum} holds since the regions $D_1,\ldots,D_M$ are disjoint.

Combining \eqref{eq:rkhs_bound} with the RKHS norm bound for $g_0$ in Lemma \ref{lem:bounded_bump} (i.e., $\|g_0\|_k \le c_1\frac{\epsilon}{h(\boldsymbol{0})}M^{\frac{\nu}{d}}$), along the the norm equivalence in Lemma \ref{lem:Sobolev-Matern-RKHS-equivalence}, we can bound the RKHS norm of $f$ by
\begin{equation} \label{eq:f_rkhsbound}
    \|f\|_k \le \frac{c' \epsilon}{h(\boldsymbol{0})}M^{\frac{\nu}{d}+\frac{1}{2}}
\end{equation}
for some constant $c'$.  Equating the right-hand side of $\eqref{eq:f_rkhsbound}$ with $B$ and rearranging, it follows that $\|f\|_k \le B$ with a choice of $\epsilon$ satisfying
\begin{equation}\label{eq:eps_M}
    \epsilon = \Theta\Big(\frac{B}{M^{\frac{\nu}{d}+\frac{1}{2}}}\Big).
\end{equation}

\subsection{Completion of the Proof of Theorem \ref{thm:noiseless_lower}}

We first consider the worst-case criterion.  Suppose there is an algorithm estimating $I$ for a function $f \in \mathcal{F}_{\rm bump}$, and the algorithm has a budget of $T = \frac{M}{2}$.  The best this algorithm can do is determine the signs of $\frac{M}{2}$ out of the $M$ bumps.  For the unexplored regions, being in the worst-case setting, we can make an adversarial argument: The adversary either makes all of these bumps negative or all of them positive, whichever leads to a higher error.  This leads to two feasible values of $I$ that differ by $\Theta(M I_0)$, which in turn implies that adversarially choosing the worse of the two must give $|I-\hat{I}| = \Omega(M I_0)$.  Hence, when $T = \frac{M}{2}$, we have
\begin{align}
    \mathcal{E}^{\rm wst}(T) &\ge \Omega\Big( \frac{M}{2}\cdot I_0 \Big) \label{eq:wst_lower1} \\
    &= \Omega(M w^d \epsilon) \label{eq:wst_lower2}\\
    &= \Omega(\epsilon), \label{eq:wst_lower3}
\end{align}
where \eqref{eq:wst_lower2} uses \eqref{eq:int_lower}, and \eqref{eq:wst_lower3} uses \eqref{eq:choice_M}.  Substituting \eqref{eq:eps_M} and $T = \frac{M}{2}$ into \eqref{eq:wst_lower3}, we obtain
\begin{equation*}
    \mathcal{E}^{\rm wst}(T) = \Omega\Big(\frac{B}{(\frac{M}{2})^{\frac{\nu}{d}+\frac{1}{2}}}\Big) = \Omega\Big(\frac{1}{T^{\frac{\nu}{d}+\frac{1}{2}}}\Big),
\end{equation*}
which establishes the desired worst-case lower bound.

For the average-case criterion, we proceed slightly differently.  We first note that the supremum in $\mathcal{E}^{\rm avg}(T) = \sup_{f\in \mathcal{F}} \mathbb{E}\big[ |I - \hat{I}| \big]$ can be lower bounded by the average with respect to $f$ drawn uniformly from $\mathcal{F}_{\rm bump}$ (and also still averaged over any randomness in the algorithm).

Now, again considering a budget of $T=\frac{M}{2}$, there must be at least $\frac{M}{2}$ regions with no samples, and for each such region, the associated integral is $+I_0$ or $-I_0$ with equal probability.  Thus, conditioned on the observed samples, the posterior distribution of $I$ can be expressed as a sum of independent random variables, one of which is of the form
\begin{equation}\label{eq:wstavg_error1}
    \mathcal{S}_{\frac{M}{2}} = \sum_{i=1}^{M/2}\delta_i \cdot I_0,
\end{equation}
where for notational convenience, we assume (without loss of generality) that it is the first $\frac{M}{2}$ regions that have no samples.  That is, $\mathcal{S}_{\frac{M}{2}}$ is a random variable expressing the posterior uncertainty in the $\frac{M}{2}$ non-sampled regions.  There may also be additional uncertainty due {\em more than $\frac{M}{2}$ regions} being non-sampled, but for proving a lower bound, it suffices to consider the  case that there is no additional uncertainty beyond $\mathcal{S}_{\frac{M}{2}}$.

Since $\delta_i$ is equiprobable on $\{+1,-1\}$, we have $\mathbb{E}[\mathcal{S}_{\frac{M}{2}}] = 0$.  Moreover, the variance of \eqref{eq:wstavg_error1} is given by
\begin{equation}\label{eq:avg_variance}
\sigma_{\mathcal{S}_{\frac{M}{2}}}^2 = \sum_{i=1}^{M/2}{\rm Var}(\delta_i \cdot I_0) = \frac{M}{2}I_0^2,
\end{equation}
since $\delta_1 I_0,\cdots,\delta_{\frac{M}{2}} I_0$ are i.i.d.~random variables each having variance $I_0^2$.
In the limit of large $M$, if we consider the normalized sum
$$
Z_{\mathcal{S}_{\frac{M}{2}}} = \frac{\mathcal{S}_{\frac{M}{2}}-\mathbb{E}[\mathcal{S}_{\frac{M}{2}}]}{\sigma_{\mathcal{S}_{\frac{M}{2}}}},
$$
by the {\em central limit theorem} (CLT) \citep[Ch.~VIII]{Fel57}, as $M\rightarrow \infty$, $Z_{\mathcal{S}_{\frac{M}{2}}}$ convergences in distribution to the standard normal distribution $N(0,1)$.  In other words  $\mathcal{S}_{\frac{M}{2}}$ is asymptotically distributed as $N(0,\sigma_{\mathcal{S}_{\frac{M}{2}}}^2)$.  When estimating a Gaussian (or an asymptotically Gaussian quantity), an average absolute error proportional to the standard deviation is unavoidable; for instance, if we know that $Z \sim N(0,\sigma_Z^2)$, then our best guess of $Z$ is $\hat{Z} = 0$, but this still gives $\mathbb{E}[|Z - \hat{Z} |] = \mathbb{E}[|Z|] = \sigma \sqrt{\frac{2}{\pi}}$.
Thus, substituting \eqref{eq:avg_variance} gives the following lower bound for $\mathcal{E}^{\rm avg}(T)$:
\begin{equation*}
    \mathcal{E}^{\rm avg}(T) \ge \Omega(\sigma_{\mathcal{S}_{\frac{M}{2}}}) = \Omega(\sqrt{M}I_0) = \Omega\Big(\frac{\epsilon}{\sqrt{M}}\Big) = \Omega\Big(\frac{1}{T^{\frac{\nu}{d}+1}}\Big),
\end{equation*}
where the final two steps use \eqref{eq:choice_M}, \eqref{eq:int_lower}, and \eqref{eq:eps_M}.

\section{Unified Derivation of Both Terms in Theorem \ref{thm:noisy_lower} (Lower Bound)} \label{app:lowerboundproof}

In this appendix, we show that analyzing a suitably chosen hard subset of functions provides an alternative derivation of both terms in Theorem \ref{thm:noisy_lower} in a unified manner.  Specifically, we consider the same class $\mathcal{F}_{\rm bump}$ that was used in the noiseless case in Appendix \ref{app:noiseless_lower}, but the analysis requires substantial modifications and is much more technical.  We proceed in several steps.

{\bf Step 1: Reduction to a simpler problem.} Similarly to the noiseless setting above, we start by lower bounding $\mathcal{E}^{\rm avg}(T,\sigma) = \sup_{f\in \mathcal{F}} \mathbb{E}\big[ |I - \hat{I}| \big]$ by $\mathbb{E}\big[ |I - \hat{I}| \big]$, where now the average is taken over three sources of randomness: the uniform distribution over $2^M$ functions in $\mathcal{F}_{\rm bump}$ (with parameters $M$ and $\epsilon$), the randomization in the algorithm, and the noise.  Moreover, once $f$ is randomized, letting the algorithm be deterministic is without loss of optimality, so we assume this is the case (this is simply an instantiation of Yao's minimax principle).

We claim that in order to attain a lower bound with the preceding prior, it suffices to attain a lower bound in the following simplified setup:
\begin{itemize}
    \item There exists an unknown collection of signs $S_i \in \{-1,+1\}$ for $i=1,\dotsc,M$, each taking either value independently with probability $\frac{1}{2}$.
    \item The goal of the algorithm is to estimate $I_{0} \sum_{i=1}^M S_i$, where $I_0$ is the integral of a single (positive) bump in the original BQ problem.
    \item At time $t$, the algorithm may select an index $i_t$ (possibly in an adaptive manner) and observe $y_t = \epsilon S_{i_t} + z_t$ with independent noise $z_t \sim N(0,\sigma^2)$.
\end{itemize}
We observe that this problem is exactly equivalent to our original problem in the case that the BQ algorithm is constrained to select midpoints of the bumps, where the bump takes its highest absolute value (i.e., $\epsilon$).  Intuitively, this is without loss of optimality because such points have the highest signal, and are thus the most informative.

To make this more formal, we note that sampling a point with absolute value $|f(x)| = c \in (0,\epsilon)$ gives $y_t = c S_{i_t} + z_t$ with $S_{i_t}$ being the associated bump sign, and this is information-theoretically equivalent to observing $y_t \frac{\epsilon}{c} = \epsilon S_{i_t} + \frac{\epsilon}{c} z_t$.  Since $\frac{\epsilon}{c} > 1$, this simply amounts to still observing $\epsilon S_{i_t}$, but with more noise, and this extra noise could always be artificially added anyway.  Hence, sampling at the midpoint is without loss of generality or optimality.\footnote{The locations with $|f(x)| = 0$ carry no information, so we can assume without loss of generality that they are never sampled.}

We proceed by studying this simplified problem.

{\bf Step 2: Establish hardness of estimating most sign values.} As a stepping stone to characterizing the difficulty of estimating $I_{0} \sum_{i=1}^M S_i$, we provide an auxiliary result on the hardness of estimating $\mathbf{S} = (S_1,\dotsc,S_M)$ to within a certain Hamming distance.  Although estimating each individual sign is a harder problem than estimating their sum (which may appear concerning from the perspective of proving a lower bound), this will turn out to be a useful intermediate step.  We let $\mywidehat{\mathbf{S}} = (\widehat{S}_1,\dotsc,\widehat{S}_M)$ denote an estimate of $\mathbf{S}$ based on the queries.

\begin{lem} \label{lem:Hamming}
    In the simplified setup with discrete queries $i_t \in \{1,\dotsc,M\}$ (rather than $x_t \in D$), consider any (possibly adaptive) deterministic algorithm that produces an estimate $\mywidehat{\mathbf{S}}$ of $\mathbf{S}$.  Then, there exists a sufficiently small constant $c$ such that we require a time horizon of
    \begin{equation}
        T \ge c \cdot M \cdot \max\bigg\{ 1, \frac{\sigma^2}{\epsilon^2} \bigg\} \label{eq:Fano_claim}
    \end{equation}
    in order to obtain $\mathbb{E}\big[ d_{\rm H}(\mathbf{S},\mywidehat{\mathbf{S}}) \big] \le \frac{M}{8}$.  Here $d_{\rm H}$ denotes the Hamming distance, and the expectation is with respect to $\mathbf{S}$ uniform on the $2^M$ possibilities, as well as the random noise.
\end{lem}
\begin{proof}
    By a standard variant of Fano's inequality with approximate recovery (e.g., see \citep[Thm.~2]{Sca19b}), we have
    \begin{equation}
        \mathbb{P}\bigg[ d_{\rm H}(\mathbf{S},\mywidehat{\mathbf{S}}) \ge \frac{M}{4} \bigg] \ge 1 - \frac{I(\mathbf{S};\mywidehat{\mathbf{S}}) + 1}{\log(2^M) - \log(N_{\max})}, \label{eq:Fano1}
    \end{equation}
    where $I(\cdot;\cdot)$ denotes the mutual information \cite{Cov01}, and $N_{\max}$ is the number of vectors in $\{-1,1\}^M$ within Hamming distance $\frac{M}{4}$ of any fixed vector (e.g., the all-ones vector).  We have $N_{\max} = \sum_{i=0}^{M/4} {M \choose i} \le M {M \choose M/4}$, from which a standard bound on the binomial coefficient gives $N_{\max} \le e^{M H_2(1/4) (1+o(1))}$ with $H_2(q) = q\log\frac{1}{q} + (1-q)\log\frac{1}{1-q}$ being the binary entropy function.  Since $H_2(1/4)$ is strictly smaller than $\log 2$, substitution into \eqref{eq:Fano1} gives
    \begin{equation}
        \mathbb{P}\bigg[ d_{\rm H}(\mathbf{S},\mywidehat{\mathbf{S}}) \ge \frac{M}{4} \bigg] \ge 1 - \frac{I(\mathbf{S};\mywidehat{\mathbf{S}}) + 1}{ \Theta(M) }. \label{eq:Fano2}
    \end{equation}
    Moreover, following standard steps, we can upper bound the numerator as follows \citep[Sec.~3]{Sca19b}:
    \begin{itemize}
        \item Use the data processing inequality to write $I(\mathbf{S};\mywidehat{\mathbf{S}}) \le I(\mathbf{S};\mathbf{I},\mathbf{Y})$, with $(\mathbf{I},\mathbf{Y})$ being the length-$T$ collection of sampled inputs and observed outputs by the algorithm.
        \item Use the chain rule for mutual information to upper bound $I(\mathbf{S};\mathbf{I},\mathbf{Y})$ by a corresponding sum over time indices: $I(\mathbf{S};\mathbf{I},\mathbf{Y}) \le \sum_{t=1}^T I(\mathbf{S}; Y_t | I_t)$.
    \end{itemize}
    To simplify the last expression, we note that given $I_t$, the only entry of $\mathbf{S}$ that impacts $Y_t$ is $S_{I_t}$, so we can further write $I(\mathbf{S}; Y_t | I_t) \le I(S_{I_t}; Y_t | I_t)$.

    Recall that when $S_{I_t}$ equals some value $s \in \{-1,1\}$, the corresponding observation is $y_t  \sim N(sI_0,\sigma^2)$.  Hence, by the relation between mutual information and KL divergence \citep[Sec.~3.3]{Sca19b}, the preceding mutual information is further upper bounded by the KL divergence between $N(\pm \epsilon, \sigma^2)$ and $N(0,\sigma^2)$ (this is the same regardless of whether $\epsilon$ has a $+1$ or $-1$ coefficient), which is $\frac{\epsilon^2}{2\sigma^2}$.

    Substituting the preceding findings back into the preceding inequality $I(\mathbf{S};\mathbf{I},\mathbf{Y}) \le \sum_{t=1}^T I(\mathbf{S}; Y_t | I_t)$, it follows that $I(\mathbf{S};\mathbf{I},\mathbf{Y}) \le \frac{T \epsilon^2}{2\sigma^2}$.  Hence, if $T < c \cdot \frac{M \sigma^2}{\epsilon^2}$ with a small enough constant $c$, then the right-hand side of \eqref{eq:Fano2} exceeds $\frac{1}{2}$.  The fact that $d_{\rm H}(\mathbf{S},\mywidehat{\mathbf{S}}) \ge \frac{M}{4}$ with probability exceeding $\frac{1}{2}$ then implies that $\mathbb{E}\big[ d_{\rm H}(\mathbf{S},\mywidehat{\mathbf{S}}) \big] > \frac{M}{8}$.

    The preceding argument proves the lemma when $\frac{\sigma^2}{\epsilon^2} \ge 1$.  On the other hand, if $\frac{\sigma^2}{\epsilon^2} < 1$, then the requirement in \eqref{eq:Fano_claim} simply becomes $T \ge cM$, which we claim to be trivially necessary for attaining $\mathbb{E}\big[ d_{\rm H}(\mathbf{S},\mywidehat{\mathbf{S}}) \big] \le \frac{M}{8}$, as long as $c \le \frac{3}{4}$.  To see this, note that with any smaller number of samples, a quarter (or more) of the indices cannot even be sampled once.  When this is the case, the algorithm cannot do any better than guessing the corresponding $S_i$ values, getting each one correct with probability $\frac{1}{2}$.
\end{proof}

The contrapositive statement of Lemma \ref{lem:Hamming} is that if $T < c \cdot M \cdot \max\big\{ 1, \frac{\sigma^2}{\epsilon^2} \big\}$, then it must hold that $\mathbb{E}\big[ d_{\rm H}(\mathbf{S},\mywidehat{\mathbf{S}}) \big] > \frac{M}{8}$.  Furthermore, by writing the Hamming distance as a sum of indicator function $\mathds{1}\{ S_i \ne \widehat{S}_i \}$, the preceding inequality can be written as
\begin{equation}
    \frac{1}{M} \sum_{i=1}^M \mathbb{P}[ S_i \ne \widehat{S}_i ] > \frac{1}{8}. \label{eq:p_bound1}
\end{equation}

{\bf Step 3: Characterize the posterior uncertainty.} In the argument that follows, we are not directly interested in $\mathbb{P}[ S_i \ne \widehat{S}_i ]$, but instead $\mathbb{P}[ S_i \ne \widehat{S}_i \,|\, \mathcal{D}]$, where $\mathcal{D} = (\mathbf{I},\mathbf{Y})$ contains the $T$ pairs of the form $(i_t,y_t)$ collected throughout the course of the algorithm.  This conditional probability can be viewed as representing the posterior uncertainty of $S_i$, with a value of $\frac{1}{2}$ meaning complete uncertainty, and a value of $0$ or $1$ meaning complete certainty.

The probability in \eqref{eq:p_bound1} is taken with respect to the joint randomness of $\mathbf{S}$ and the noise (which enters via $\mathcal{D}$).  While the decomposition $\mathbb{P}[\mathbf{S}]\mathbb{P}[\mathcal{D} | \mathbf{S}]$ is most natural, it is useful to consider the opposite form $\mathbb{P}{\mathcal{D}}\mathbb{P}[\mathbf{S}|\mathcal{D}]$, so that we can analyze the {\em posterior distribution} $\mathbb{P}[\mathbf{S}|\mathcal{D}]$.

With this in mind, we claim that the following holds with probability at least $\frac{1}{16}$ {\em with respect to $\mathcal{D}$} (i.e., any ``remaining'' probability is with respect to $\mathbb{P}[\mathbf{S}|\mathcal{D}]$):
\begin{equation}
    \frac{1}{M} \sum_{i=1}^M \mathbb{P}[ S_i \ne \widehat{S}_i \,|\, \mathcal{D} ] > \frac{1}{16}. \label{eq:p_bound2}
\end{equation}
To see this, assume by contradiction that this were only to hold with probability less than $\frac{1}{16}$.  Then, letting $\mathcal{A}$ denote the event that \eqref{eq:p_bound2} holds, we would have
\begin{align*}
    \frac{1}{M} \sum_{i=1}^M \mathbb{P}[ S_i \ne \widehat{S}_i]
        &= \mathbb{E}\bigg[ \frac{1}{M} \sum_{i=1}^M \mathbb{P}[ S_i \ne \widehat{S}_i | \mathcal{D}] \bigg] \\
        &= \mathbb{E}\bigg[ \frac{1}{M} \sum_{i=1}^M \mathbb{P}[ S_i \ne \widehat{S}_i | \mathcal{D}] \, \mathds{1} \{\mathcal{D} \in \mathcal{A}\} \bigg] + \mathbb{E}\bigg[ \frac{1}{M} \sum_{i=1}^M \mathbb{P}[ S_i \ne \widehat{S}_i | \mathcal{D}]\, \mathds{1} \{\mathcal{D} \notin \mathcal{A}\} \bigg].
\end{align*}
where the first line uses the tower property of expectation.  Then, the two terms are bounded as follows:
\begin{itemize}
    \item Using what we assumed by contradiction and upper bounding $\frac{1}{M} \sum_{i=1}^M \mathbb{P}[ S_i \ne \widehat{S}_i \,|\, \mathcal{D} ] \le 1$, the first term is at most $\frac{1}{16}$.
    \item Using the opposite inequality to \eqref{eq:p_bound2} for $\mathcal{D} \notin \mathcal{A}$, and upper bounding $\mathds{1}\{\cdot\} \le 1$, the second term is also at most $\frac{1}{16}$.
\end{itemize}
Thus, we obtain $\frac{1}{M} \sum_{i=1}^M \mathbb{P}[ S_i \ne \widehat{S}_i] \le \frac{1}{8}$, which contradicts \eqref{eq:p_bound1}, and we conclude that \eqref{eq:p_bound2} must hold with probability at least $\frac{1}{16}$ (with respect to $\mathcal{D}$).

We now apply a similar argument to the preceding one, but considering the uniform distribution over $M$ implicit in \eqref{eq:p_bound2} (as opposed to the distribution of $\mathcal{D}$).  Omitting the details to avoid repetition, it follows that at least $\frac{M}{32}$ of the indices in $\{1,\dotsc,M\}$ have $\mathbb{P}[ S_i \ne \widehat{S}_i | \mathcal{D} ] > \frac{1}{32}$; any smaller number than $\frac{M}{32}$ would contradict \eqref{eq:p_bound2}.

The above findings are summarized in the following lemma.

\begin{lem} \label{eq:posterior}
    Under the setup of Lemma \ref{lem:Hamming}, if
    \begin{equation}
        T < c \cdot M \cdot \max\bigg\{ 1, \frac{\sigma^2}{\epsilon^2} \bigg\} \label{eq:posterior_claim}
    \end{equation}
    for sufficiently small $c > 0$, then with probability at least $\frac{1}{16}$ (with respect to $\mathcal{D}$), there exist at least $\frac{M}{32}$ indices such that $\mathbb{P}[ S_i \ne \widehat{S}_i \,|\, \mathcal{D} ] > \frac{1}{32}$.
\end{lem}

{\bf Step 4: Central limit theorem.} We now return to the problem formed in Step 1, where the goal is to estimate $I_0 \sum_{i=1}^M S_i$, and the algorithm does not necessarily form any entry-by-entry estimate $\mywidehat{\mathbf{S}}$.  We continue to let $\mathcal{D}$ denote the samples collected, and we let $\mathcal{D}_i$ denote the subset of $\mathcal{D}$ corresponding to times when $i_t = i$.

\begin{lem} \label{lem:conditioning}
    Under the uniform prior on $\mathbf{S} = (S_1,\dotsc,S_M)$, conditioned on any collection of samples $\mathcal{D}$, we have that the signs $(S_1,\dotsc,S_M)$ remain conditionally independent.
\end{lem}
\begin{proof}
    This is immediate from the fact that we consider an independent prior (namely, the uniform prior over all $2^M$ sign patterns) and assume that the noise terms between times are independent.  Thus, whenever some index $i_t$ is selected, the resulting observation $y_t$ bears information about $S_{i_t}$, but bears no information about any of the other $S_j$.
\end{proof}

By Lemma \ref{lem:conditioning}, conditioned on $\mathcal{D}$, the posterior distribution of $\sum_{i=1}^M S_i$ is a sum of independent $\pm 1$-valued random variables.  Moreover, by Lemma \ref{eq:posterior}, when $T$ satisfies \eqref{eq:posterior_claim} it holds with probability at least $\frac{1}{16}$ that at least $\frac{1}{32}$ fraction of these indices have strictly positive posterior variance.  This, in turn, implies that $I_0 \sum_{i=1}^M S_i$ has a posterior variance of $\Theta(M I_0^2)$.

Having a constant fraction of strictly positive-variance terms is sufficient for applying the central limit theorem for independent but non-identical random variables \citep[Ch.~VIII]{Fel57}.  By doing so, we find that $I_0 \sum_{i=1}^M S_i$ is asymptotically Gaussian; the mean is inconsequential for our purposes, and the variance scales as $\Omega(M I_0^2)$, i.e., the standard deviation is $\Omega(\sqrt{M} \cdot I_0)$.
As highlighted in Appendix \ref{app:noiseless_lower}, when we have a posterior standard deviation of $\Omega(\sqrt{M} \cdot I_0)$, we incur $\Omega(\sqrt{M} \cdot I_0)$ error.  Since we have shown that this is the case with constant probability, it follows that the average error is $\Omega(\sqrt{M} \cdot I_0)$.

{\bf Step 5: Simplification.} Recall from Appendix \ref{app:noiseless_lower} that in our function class, we have $M = \big\lfloor \frac{1}{w} \big\rfloor^d$, $I_0 = \Theta(w^d \epsilon) = \Theta\big( \frac{\epsilon}{M} \big)$, and $\epsilon = \Theta\big( \frac{1}{M^{\nu/d + 1/2}} \big)$.  Hence, the scaling $\Omega(\sqrt{M} \cdot I_0)$ can be expressed as $\Omega\big( \frac{\epsilon}{\sqrt M} \big)$.  We now complete the proof by considering two cases:
\begin{itemize}
    \item If the maximum in \eqref{eq:posterior_claim} is achieved by the first term, then we have $M = \Theta(T)$ (supposing that $T$ is as high as possible subject to \eqref{eq:posterior_claim}).  Moreover, the above-established fact $\epsilon = \Theta\big( \frac{1}{M^{\nu/d + 1/2}} \big)$ gives $\frac{\epsilon}{\sqrt M} = \Theta\big( \frac{1}{M^{\frac{\nu}{d}+1}} \big)$. Combining these two findings, the lower bound is $\Omega\big( \frac{1}{T^{\frac{\nu}{d}+1}} \big)$.
    \item If the maximum in \eqref{eq:posterior_claim} is achieved by the second term, then we get $M = \Theta\big( \frac{T\epsilon^2}{\sigma^2} \big)$, or equivalently $\frac{\epsilon}{\sqrt{M}} = \Theta\big( \frac{\sigma}{\sqrt T} \big)$.  Hence, the lower bound is $\Omega\big( \frac{\sigma}{\sqrt{T}} \big)$.
\end{itemize}
Combining these two cases, we obtain a final lower bound of $\mathcal{E}^{\rm avg}(T,\sigma) = \Omega\big( \max\big\{ \frac{\sigma}{\sqrt{T}}, \frac{1}{T^{\frac{\nu}{d}+1}}  \big\} \big)$.  This is equivalent to $\Omega(T^{\frac{\nu}{d}-1} + \sigma T^{-\frac{1}{2}})$, and the proof of Theorem \ref{thm:noisy_lower} is complete.

\section{Proof of Lemma \ref{lem:l2-error} (Upper Bound on the $L^2$ Error)}
\label{app:proof-lem-l2-error}

We state two useful results from \cite{Wyn21} on the $L^2$ estimation error for functions in Sobolev spaces, and their adaptation to our setting for functions in RKHS with Mat\'ern kernel.

These results depend on various technical assumptions made in \cite{Wyn21}, most of which are trivially satisfied in our setting.  In particular:
\begin{itemize}
    \item Assumption 1 in (in \cite{Wyn21}) concerns the regularity of the domain, and permits our choice $D = [0,1]^d$.
    \item Assumptions 2--5 therein concern the function class and the level of misspecification, and hold true for Mat\'ern RKHS functions the well-specified setting as we consider.  In particular, a Sobolev parameter therein is assumed to exceed $d/2$, which is trivial in our setting where the parameter is $\nu + d/2$ (see Lemma \ref{lem:Sobolev-Matern-RKHS-equivalence}).
    \item Assumption 4 therein also imposes an assumption on a certain mean function, which is trivial in our setting where we use a GP with mean zero.
\end{itemize}

\begin{lem} \label{lem:l2-error-2}
    {\em (Adaptation of \citep[Corollary 5]{Wyn21})}
    Let $f$ be any function in $W^s_2$, and fix $\bar{s} \in [0,s]$. Let $\mathbf{x}_{1:n}=\{\mathbf{x}_1,\dots,\mathbf{x}_n\}$, $y_{1:n}=\{y_1,\dots,y_n\}$ be the sequence of points and their noisy observations selected by the maximum variance strategy (see the first part of Algorithm \ref{alg:two-phase-bq}), and further define $\mu_n$ to be the Gaussian posterior mean after $n$ observations. Then, there exists a universal constant $C>0$ such that
    \begin{equation}
        \|f-\mu_n\|_{W^{\bar{s}}_{2}(X)}
        \leq C n^{-\frac{1}{2}+\frac{\bar{s}}{d}}\Big(\|\varepsilon\|_{2}+n^{-\frac{s}{d}+\frac{1}{2}}\|f\|_{W^s_2}\Big), \label{eq:wynne2}
    \end{equation}
    where $\varepsilon=(\epsilon_1,\dots,\epsilon_n)$ is the vector of noise terms.
\end{lem}

To obtain this lemma from \citep[Corollary 5]{Wyn21}, we substitute $s\leftarrow\bar{s}, \tau_f\leftarrow s$, $\tau^+=\tau^- \leftarrow s+d/2$, $q=2$, and $m(\cdot) \leftarrow 0$ in the notation therein.  We note that their result considers random noise, and accordingly includes an expectation operation on both sides of \eqref{eq:wynne2}.  However, as discussed in \citep[Section 4.3.1]{Wyn21}, the distribution on the noise is arbitrary, and the result only depends on $\mathbb{E}[\|\varepsilon\|]_2$.  In particular, applying the results with an arbitrary deterministic ``distribution'' gives the form stated above, with no expectation involved.

With these auxiliary results in place, we now proceed with the proof of Lemma \ref{lem:l2-error}. Applying Lemma \ref{lem:l2-error-2} with $n=T/2$ and $\mu_n=\mu_{T/2}$, yielding
\begin{equation}
    \lVert f-\mu_{T/2}\rVert_{W^{\bar{s}}_2} = O\bigg(\Big(\dfrac{T}{2}\Big)^{-\frac{1}{2}+\frac{\bar{s}}{d}}\Big(\lVert\varepsilon\rVert_2+\Big(\dfrac{T}{2}\Big)^{-\frac{s}{d}+\frac{1}{2}}\lVert f\rVert_{W_2^{s}}\Big)\bigg). \label{eq:initial}
\end{equation}
Letting $s=\nu+d/2$, the equivalence between the RKHS and Sobolev space established in Lemma \ref{lem:Sobolev-Matern-RKHS-equivalence} gives $\lVert f\rVert_{W_2^{s}}=\Theta\left(\lVert f\rVert_{\mathcal{F}(D)}\right)=O(B)$, which simplifies to $O(1)$ because we treat $B$ as a constant.

In accordance with Lemma \ref{lem:l2-error-2}, we are free to set $\bar{s}$ to our liking in \eqref{eq:initial}.  We choose $\bar{s} = 0$ (along with $s = \nu + d/2$), and since $\|\cdot\|_{W_2^0}$ recovers the $L^2$ norm, we obtain
\begin{align}
    \lVert f-\mu_{T/2}\rVert_{L^2}
    =O\bigg(\Big(\dfrac{T}{2}\Big)^{-\frac{1}{2}}\cdot\Big(\lVert\varepsilon\rVert_2+\Big(\dfrac{T}{2}\Big)^{-\frac{\nu}{d}}\Big)\bigg). \label{eq:intermediate}
\end{align}
Recall that $\varepsilon=(\epsilon_1,\dots,\epsilon_{T/2})$, and in our setting we consider $\epsilon_i\sim N(0,\sigma^2)$, which gives  $\mathbb{E}\left[\lVert\varepsilon\rVert_2^2\right]=\frac{T}{2}\sigma^2$ and $\mathbb{E}\left[\lVert\varepsilon\rVert_2\right] \leq \sqrt{\mathbb{E}\left[\lVert\varepsilon\rVert_2^2\right]} = \left(\frac{T}{2}\right)^{1/2} \sigma$. Thus, squaring both sides of \eqref{eq:intermediate} and averaging over the noise terms gives
\begin{align}
    \mathbb{E}\Big[\lVert f-\mu_{T/2}\rVert_{L^2}^2\Big]
        &= O\bigg(\Big(\dfrac{T}{2}\Big)^{-1}\cdot\Big(\mathbb{E}\left[\lVert\varepsilon\rVert_2\right]+\Big(\dfrac{T}{2}\Big)^{-\frac{\nu}{d}}\Big)^2\bigg) \\
        &= O\bigg(\Big(\dfrac{T}{2}\Big)^{-1}\cdot\Big(\Big(\frac{T}{2}\Big)\sigma^2+\Big(\dfrac{T}{2}\Big)^{-\frac{2\nu}{d}}\Big)\bigg) \\
        &= O\bigg(\Big(\Big(\dfrac{T}{2}\Big)^{-\frac{\nu}{d}-\frac{1}{2}}+\sigma\Big)^2\bigg), \label{eq:l2-error-2}
\end{align}
which proves Lemma \ref{lem:l2-error}.

\section{Alternative Analysis Based on Confidence Bounds} \label{app:max_var}

In this section, we present an analysis based on constructing confidence intervals of the true function on each time step, which is a popular strategy in the analysis Bayesian optimization (BO) algorithms.  Our analysis is most closely related to that of the BO simple regret in \cite{Vak21}.

We will see that simply adapting confidence interval based techniques to BQ gives rise to a suboptimal bound.  The maximum variance sampling technique is already presented in the first half of algorithm \ref{alg:two-phase-bq}, but is stated as a standalone procedure in Algorithm \ref{alg:max-var-sampling} for convenience.

\begin{algorithm}
	\caption{Bayesian quadrature with maximum variance sampling.} \label{alg:max-var-sampling}
	\begin{algorithmic}[1]
		\STATE {\bfseries Input:} Domain $D$, GP prior ($\mu_0$, $k_0$), time horizon $T$.
		\FOR{$t=1,\dots,T$}
		\STATE Select $\mathbf{x}_t=\argmax_{\mathbf{x}\in D}\sigma_{t-1}(\mathbf{x})$.
		\STATE Receive $y_t=f(\mathbf{x}_t)+\epsilon_t$.
		\STATE Update $\sigma_t$ using $\mathbf{x}_1,\dotsc,\mathbf{x}_t$.
		\ENDFOR
		\STATE Update $\mu_T(\mathbf{x})$ using $\mathbf{x}_1,\dotsc,\mathbf{x}_t,y_1,\dotsc,y_t$.
		\STATE Output $\int p(\mathbf{x})\mu_T(\mathbf{x})d\mathbf{x}$
	\end{algorithmic}
\end{algorithm}

\begin{thm} \label{thm:max-var-upper}
    Consider our problem setup with constant parameters $(B,\nu,d,l,p_{\max})$ satisfying $\nu+\frac{d}{2}\in\mathbb{N}^{+}$, noise variance $\sigma^2$, and time horizon $T$.  For any fixed $f\in\mathcal{F}_l(B)$ and $p \in \mathcal{P}(p_{\max})$, with probability at least $1-\delta$ (averaged over the noisy samples), the error incurred by Algorithm \ref{alg:max-var-sampling} satisfies     \begin{equation}
        |I - \hat{I}| =O\bigg(T^{-\frac{\nu}{2\nu+d}} (\log{T})^{\frac{\nu}{2\nu+d}}\Big(d\log{T}+\log{\dfrac{1}{\delta}}\Big)\bigg).
    \end{equation}
\end{thm}

Different from our earlier results, this result is stated with high probability, rather than in expectation.  However, we can easily convert to the latter by choosing $\delta$ small enough, e.g., $\delta = \frac{1}{T}$.

We first provide several existing results that we use to prove Theorem \ref{thm:max-var-upper}.

\begin{lem} \label{lem:Lipschitzness}
    {\em \citep[Proposition 1 \& Remark 5]{She20}} Let $\mathcal{F}(B)$ be the set of functions whose RKHS norm is upper bounded by a constant $B>0$, for the Mat\'ern-$\nu$ kernel with $\nu>1$. Then $f$ is $L$-Lipschitz continuous with some constant $L$ depending only on the kernel parameters.
\end{lem}

In the following, we use the shorthand notation $\mathbf{x}_{1:T} = (\mathbf{x}_1,\dotsc,\mathbf{x}_T)$, and similarly for other quantities indexed by $t$.  Recall also the posterior mean and variance defined in \eqref{eq:posterior_mean}--\eqref{eq:posterior_variance}, with parameter $\lambda > 0$.

\begin{lem} \label{lem:ci}
	{\em (Confidence Intervals, Theorem 1 in \cite{Vak21})}
	Fix a function $f$ satisfying $\lVert f \rVert_k \leq B$, and assume that the noise terms $\epsilon_1,\dotsc,\epsilon_T$ are i.i.d.~$R$-sub-Gaussian random variables. Assume further that $\mathbf{x}_{1:T}$ are independent of $\epsilon_{1:T}$, i.e., the points are chosen non-adaptively. For a fixed $\mathbf{x}\in\mathcal{X}$, for any $t\in[T]$, define the upper and lower confidence bounds as
	\begin{align*}
		U_t^\delta(\mathbf{x})&=\mu_t(\mathbf{x})+(B+\beta(\delta))\sigma_t(\mathbf{x}), \\
		L_t^\delta(\mathbf{x})&=\mu_t(\mathbf{x})-(B+\beta(\delta))\sigma_t(\mathbf{x}),
	\end{align*}
	with $\beta(\delta)=\frac{R}{\lambda}\sqrt{2\log{\dfrac{1}{\delta}}}$, and $\delta\in(0,1)$.  Then, we have for any $\mathbf{x}\in D$ that
	\begin{align}
		f(\mathbf{x})&\leq U_t^\delta(\mathbf{x}) \quad \textrm{w.p. at least } 1-\delta \\
		f(\mathbf{x})&\geq L_t^\delta(\mathbf{x}) \quad \textrm{w.p. at least } 1-\delta.
	\end{align}
\end{lem}

\begin{lem} [Variant of Lemma 5.4 in \cite{Sri09}] \label{lem:sum-var}
	Letting $\gamma_T=\sup_{x_{1:T}\subseteq D} I(y_{1:T};f_{1:T})$, where $f_{1:T}=(f(\mathbf{x}_{1:T}))\in\mathbb{R}^T$ denotes the function values at the points $\mathbf{x}_1,\dots,\mathbf{x}_T$, we have
	\begin{equation}
		\sum_{t=1}^T \sigma_{t-1}^2(\mathbf{x}_t) \leq \dfrac{2\gamma_T}{\log{\left(1+\frac{1}{\lambda^2}\right)}}.
	\end{equation}
\end{lem}

\begin{proof}[\unskip\nopunct] {\em Proof of Theorem \ref{thm:max-var-upper}.}
Let $\widetilde{D}$ be a finite subdomain of $D=[0,1]^d$ with $T^{d/2}$ points, with equal spacing of width $\frac{1}{\sqrt{T}}$ in each dimension. For any $\mathbf{x}\in D$, let $[\mathbf{x}]_{\widetilde{D}}=\argmin_{\mathbf{x}^\prime\in\widetilde{D}}\lVert \mathbf{x}-\mathbf{x}^\prime \rVert_2$. By construction, we have, for any $\mathbf{x}\in D$ that
\begin{equation}
    \lVert\mathbf{x}-[\mathbf{x}]_{\widetilde{D}}\rVert_2 \leq \dfrac{\sqrt{d}}{\sqrt{T}} = O\Big(\dfrac{1}{\sqrt{T}}\Big).
\end{equation}
By Lemma \ref{lem:Lipschitzness}, the function $f$ is $L$-Lipschitz. Thus we have, for any $\mathbf{x}\in D$ that
\begin{equation}
    |f(\mathbf{x})-f([\mathbf{x}]_{\widetilde{D}}| \leq L\lVert\mathbf{x}-[\mathbf{x}]_{\widetilde{D}}\rVert_2 = O\Big(\dfrac{L}{\sqrt{T}}\Big). \label{eq:lipschitz-discretization}
\end{equation}
For any fixed $\mathbf{x}\in\widetilde{D}$, applying Lemma \ref{lem:ci} gives the following with probability at least $1-\frac{\delta}{2\lvert\widetilde{D}\rvert}$:
\begin{equation}
	f(\mathbf{x}) \geq \mu_T(\mathbf{x}) - \bigg(B + \beta\Big(\frac{\delta}{\lvert\widetilde{D}\rvert}\Big)\bigg)\sigma_T(\mathbf{x}).
\end{equation}
By union bound over all $\mathbf{x}\in\widetilde{D}$, we have, for all $\mathbf{x}\in\widetilde{D}$ simultaneously that
\begin{equation}
	f(\mathbf{x}) \geq \mu_T(\mathbf{x}) - \bigg(B + \beta\Big(\frac{\delta}{\lvert\widetilde{D}\rvert}\Big)\bigg)\sigma_T(\mathbf{x}), \label{eq:up-ci}
\end{equation}
with probability at least $1-\frac{\delta}{2}$. Similarly, we have, for all $\mathbf{x}\in\widetilde{D}$ that
\begin{equation}
	f(\mathbf{x}) \leq \mu_T(\mathbf{x}) + \bigg(B + \beta\Big(\frac{\delta}{\lvert\widetilde{D}\rvert}\Big)\bigg)\sigma_T(\mathbf{x}), \label{eq:lo-ci}
\end{equation}
with probability at least $1-\frac{\delta}{2}$. Combining \eqref{eq:up-ci} and \eqref{eq:lo-ci}, and again applying the union bound, we have, for all $\mathbf{x}\in\widetilde{D}$ that
\begin{equation}
	\lvert f(\mathbf{x})-\mu_T(\mathbf{x})\rvert \leq \bigg(B + \beta\Big(\frac{\delta}{\lvert\widetilde{D}\rvert}\Big)\bigg)\sigma_T(\mathbf{x}), \label{eq:ci}
\end{equation}
with probability at least $1-\delta$. We now extend the above upper bound to any point $\mathbf{x}$ in the domain $D$:
\begin{align}
	\lvert f(\mathbf{x})-\mu_T(\mathbf{x})\rvert
	&\leq \left\lvert f(\mathbf{x})-f([\mathbf{x}]_{\widetilde{D}})+f([\mathbf{x}]_{\widetilde{D}})-\mu_T([\mathbf{x}]_{\widetilde{D}})+\mu_T([\mathbf{x}]_{\widetilde{D}})-\mu_T(\mathbf{x})\right\rvert \nonumber \\
	&\leq \left\lvert f(\mathbf{x})-f([\mathbf{x}]_{\widetilde{D}}) \right\lvert+\left\lvert f([\mathbf{x}]_{\widetilde{D}})-\mu_T([\mathbf{x}]_{\widetilde{D}})\right\lvert+\left\lvert\mu_T([\mathbf{x}]_{\widetilde{D}})-\mu_T(\mathbf{x})\right\rvert \nonumber \\
	&\leq O\Big(\dfrac{L}{\sqrt{T}}\Big) + \bigg(B + \beta\Big(\frac{\delta}{\lvert\widetilde{D}\rvert}\Big)\bigg)\sigma_T([\mathbf{x}]_{\widetilde{D}}) + O\Big(\dfrac{L}{\sqrt{T}}\Big), \label{eq:up-bound}
\end{align}
where the second inequality is by applying the triangle inequality, and the third inequality is due to \eqref{eq:ci} and \eqref{eq:lipschitz-discretization}.

We will now show an upper bound on the posterior variance $\sigma_T(\mathbf{x})$. Due to the decreasing property of posterior variance, we know that $\sigma_{t+1}(\mathbf{x})\leq\sigma_t(\mathbf{x})$ for all $\mathbf{x}$ and $t$. Furthermore, due to the maximum variance sampling strategy, we have $\sigma_{t-1}(\mathbf{x}_t)\geq\sigma_{t-1}(\mathbf{x})$. Thus, we have
\begin{align}
	\sigma_T([\mathbf{x}]_{\widetilde{D}}) \leq \sigma_{t-1}([\mathbf{x}]_{\widetilde{D}}) \leq \sigma_{t-1}(\mathbf{x}_t)
\end{align}
for all $\mathbf{x}$ and $t \le T$.  Squaring and averaging over $t\in[T]$ gives
\begin{equation}
	\sigma_T^2([\mathbf{x}]_{\widetilde{D}}) \leq \dfrac{1}{T}\sum_{t=1}^T \sigma_{t-1}^2(\mathbf{x}_t),
\end{equation}
and applying Lemma \ref{lem:sum-var}, we obtain
\begin{equation}
	\sigma_T([\mathbf{x}]_{\widetilde{D}})\leq\sqrt{\dfrac{2\gamma_T}{T\log{\Big(1+\dfrac{1}{\lambda^2}\Big)}}}. \label{eq:sigma_bound}
\end{equation}
Substituting \eqref{eq:sigma_bound} and $\lvert\widetilde{D}\rvert=T^{d/2}$ into \eqref{eq:up-bound}, and recalling the definition of $\beta(\cdot)$ in Lemma \ref{lem:ci}, we obtain
\begin{align}
	\lvert f(\mathbf{x})-\mu_T(\mathbf{x})\rvert
	&\leq O\Big(\dfrac{L}{\sqrt{T}}\Big) + \Big(B+\dfrac{R}{\lambda}\sqrt{d\log{T}+2\log{\dfrac{1}{\delta}}}\Big)\sqrt{\dfrac{2\gamma_T}{T\log{\Big(1+\dfrac{1}{\lambda^2}\Big)}}} \\
	&=O\bigg(\sqrt{\dfrac{\gamma_T}{T} \Big(d\log{T}+\log{\dfrac{1}{\delta}}\Big)}\bigg).
\end{align}
Finally, the absolute error of the above algorithm can then be upper bounded by
\begin{align}
	\Big|\int_D p(\mathbf{x}) (f(\mathbf{x})-\mu_T(\mathbf{x}))d\mathbf{x} \Big|
	\leq \max_{\mathbf{x}\in D} \big|f(\mathbf{x})-\mu_T(\mathbf{x})\big| \int_D p(\mathbf{x})d\mathbf{x}
	=O\bigg(\sqrt{\dfrac{\gamma_T}{T} \Big(d\log{T}+\log{\dfrac{1}{\delta}}\Big)}\bigg).
\end{align}
with probability at least $1-\delta$. For Mat\'ern-$\nu$ kernel, $\gamma_T=O\big(T^{\frac{d}{2\nu +d}}(\log{T})^{\frac{2\nu}{2\nu +d}}\big)$ \cite{Vak21}, which concludes the proof.
\end{proof}

\section{Additional Experimental Results} \label{app:addexp}

\subsection{Comparison of Different Noise Levels} \label{app:addexp-noise}

In Figures \ref{fig:varynoise-1}, \ref{fig:varynoise-2}, and \ref{fig:varynoise-3}, we present a more comprehensive set of results on synthetic kernel-based functions and benchmark functions.  Overall, while there is no definitive ordering between the methods in general, we observe a clear trend of MVS being favorable at low noise levels while potentially being poor at high noise levels, and vice versa for Monte Carlo.  MVS-MC is typically able to attain the benefits of both.

We note that some of the MVS curves can be highly non-monotone (e.g., Figure \ref{fig:varynoise-3}, sub-figures (a) and (b), high noise).  We believe that this is because the only randomness in MVS is in the noise and the 3 initial points, whereas MC and MVS-MC have much more randomness due to being randomized algorithms.  When there is limited randomness and few queries have been made, the algorithm is essentially outputting an uncertain guess, and it can happen that this guess luckily has a low error, but then this luck diminishes as more samples are taken.  In contrast, MVS-MC and MC have enough internal randomness to ``average out'' the lucky and unlucky scenarios.

\begin{figure}
    \centering
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/synthetic/syn1-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/synthetic/syn1-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/synthetic/syn1-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/synthetic/syn1-0.1.pdf}

        \caption{Synthetic-1D}
    \end{subfigure}

    \vskip 0.2in
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/synthetic/syn2-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/synthetic/syn2-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/synthetic/syn2-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/synthetic/syn2-0.1.pdf}

        \caption{Synthetic-2D}
    \end{subfigure}

    \vskip 0.2in
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/synthetic/syn3-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/synthetic/syn3-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/synthetic/syn3-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/synthetic/syn3-0.1.pdf}

        \caption{Synthetic-3D}
    \end{subfigure}

    \vskip 0.2in
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/synthetic/syn4-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/synthetic/syn4-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/synthetic/syn4-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/synthetic/syn4-0.1.pdf}
        \caption{Synthetic-4D}
    \end{subfigure}

    \caption{Comparison of algorithms and the effect of noise (1 of 3). \label{fig:varynoise-1}}
\end{figure}

\begin{figure}
    \centering
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/1d/ack1-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/1d/ack1-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/1d/ack1-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/1d/ack1-0.1.pdf}

        \caption{Ackley-1D}
    \end{subfigure}

    \vskip 0.2in
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/1d/alp1-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/1d/alp1-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/1d/alp1-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/1d/alp1-0.1.pdf}

        \caption{Alpine-1D}
    \end{subfigure}

    \vskip 0.2in
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/1d/gl-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/1d/gl-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/1d/gl-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/1d/gl-0.1.pdf}

        \caption{Gramacy-Lee-1D}
    \end{subfigure}

    \vskip 0.2in
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/1d/gri1-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/1d/gri1-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/1d/gri1-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/1d/gri1-0.1.pdf}
        \caption{Griewank-1D}
    \end{subfigure}

    \caption{Comparison of algorithms and the effect of noise (2 of 3). \label{fig:varynoise-2}}
\end{figure}

\begin{figure}
    \centering
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/ack2-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/ack2-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/ack2-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/ack2-0.1.pdf}

        \caption{Ackley-2D}
    \end{subfigure}

    \vskip 0.2in
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/alp2-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/alp2-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/alp2-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/alp2-0.1.pdf}

        \caption{Alpine-2D}
    \end{subfigure}

    \vskip 0.2in
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/gri2-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/gri2-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/gri2-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/gri2-0.1.pdf}
        \caption{Griewank-2D}
    \end{subfigure}

    \vskip 0.2in
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/keane-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/keane-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/keane-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/keane-0.1.pdf}

        \caption{Keane-2D}
    \end{subfigure}

    \vskip 0.2in
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/ras-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/ras-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/ras-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/benchmark/2d/ras-0.1.pdf}
        \caption{Rastrigin2d-2D}
    \end{subfigure}

    \caption{Comparison of algorithms and the effect of noise (3 of 3). \label{fig:varynoise-3}}
\end{figure}

\subsection{Comparison of Different Splits} \label{app:addexp-split}

Further comparisons of the effect of different split sizes in MVS-MC (as described in Section \ref{sec:effect_split}) are shown in Figure \ref{fig:varysplit-1}.  Similarly to the examples in the main text, we find that the trend can be decreasing (particularly at low noise), increasing (particularly at high noise), or "U"-shaped, but that $0.5$ is generally a reasonable choice.

\begin{figure}
    \centering
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/splits/1d/split-ack1-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/splits/1d/split-ack1-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/splits/1d/split-ack1-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/splits/1d/split-ack1-0.1.pdf}

        \caption{Ackley-1D}
    \end{subfigure}

    \vskip 0.2in
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/splits/1d/split-alp1-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/splits/1d/split-alp1-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/splits/1d/split-alp1-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/splits/1d/split-alp1-0.1.pdf}

        \caption{Alpine-1D}
    \end{subfigure}

    \vskip 0.2in
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/splits/1d/split-gl-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/splits/1d/split-gl-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/splits/1d/split-gl-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/splits/1d/split-gl-0.1.pdf}

        \caption{Gramacy-Lee-1D}
    \end{subfigure}

    \vskip 0.2in
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/splits/2d/split-ack2-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/splits/2d/split-ack2-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/splits/2d/split-ack2-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/splits/2d/split-ack2-0.1.pdf}

        \caption{Ackley-2D}
    \end{subfigure}

    \vskip 0.2in
    \begin{subfigure}{\columnwidth}
        \centering
        \includegraphics[width=0.24\columnwidth]{figs/splits/2d/split-gri2-0.001.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/splits/2d/split-gri2-0.01.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/splits/2d/split-gri2-0.05.pdf}
        \includegraphics[width=0.24\columnwidth]{figs/splits/2d/split-gri2-0.1.pdf}

        \caption{Griewank-2D}
    \end{subfigure}

    \caption{Comparison of different MVS-MC splits, i.e., the fraction of rounds for which MVS is used. \label{fig:varysplit-1}}

\end{figure}

\subsection{Sensor Measurement Data} \label{app:addexp-sensor}

We consider the problem of estimating an average sensor reading from limited queries, which each query consists of reading the value at a given time instant.  Note that since the algorithms we consider are non-adaptive, the query times can be pre-computed.  The data set consists of energy consumption readings for London Households that took part in the UK Power Networks led Low Carbon London Project, between November 2011 and February 2014 \footnote{The data can be downloaded at \href{https://data.london.gov.uk/dataset/smartmeter-energy-use-data-in-london-households}{data.london.gov.uk}. }.

We construct a time-series signal (shown in Figure \ref{fig:sensor}) of length 19,548 by sampling the data at intervals of one hour.  Our goal is to estimate the average energy consumption during this period. Although the domain is now discrete, we let MVS and MVS-MC work on the continuous space, and round the selected decimal value to the nearest point in the data set.  To create a {\em noisy} BQ problem, we artificially add Gaussian $N(0,\sigma^2)$ noise to each query, choosing $\sigma \in \{0.05,0.5,0.8\}$ to be higher than the other experiments in view of the larger function scale.

The results are shown in Figure \ref{fig:energy}, where we observe similar trends as in the case of synthetic functions.  Specifically, MVS-MC and MC behave similarly, and MVS is favorable at low noise but worse at high noise.

\begin{figure}[!t]
\centering

     \includegraphics[width=\textwidth]{figs/realworld/energy-ts-demo.pdf}

    \caption{Time-series function for energy measurements. \label{fig:sensor}}
\end{figure}

\begin{figure}[!t]
\centering
    \begin{subfigure}[b]{0.32\linewidth}
    \includegraphics[width=\linewidth]{figs/realworld/energy-0.05.pdf}
    \end{subfigure}
    \begin{subfigure}[b]{0.32\linewidth}
    \includegraphics[width=\linewidth]{figs/realworld/energy-0.5.pdf}
    \end{subfigure}
    \begin{subfigure}[b]{0.32\linewidth}
    \includegraphics[width=\linewidth]{figs/realworld/energy-0.8.pdf}
    \end{subfigure}

    \caption{Results for time series energy data. \label{fig:energy}}
\end{figure}
\section{Introduction} \label{sec:intro}

The integration of black-box functions is a fundamental problem with numerous applications, with Bayesian inference being a prominent example. The method of {\em Bayesian Quadrature} (BQ) \cite{Oha91, Ras03} has particularly gained popularity, adopting Bayesian modeling techniques to model the unknown function and reduce the required number of function evaluations.  Mathematically, the goal is to approximate the quantity
\begin{equation*}
    I(f) = \int f(\mathbf{x})p(\mathbf{x})d\mathbf{x}, \label{eq:integral0}
\end{equation*}
where $p(\mathbf{x})$ is a known weighting function, but we only have black-box access to $f(\mathbf{x})$.

While it is often reasonable to assume that queries to the function are noiseless, there is also substantial motivation to understand the impact of noise.  For instance, when performing integrals in Bayesian inference, function evaluations themselves may be implemented using a randomized subroutine whose variations can be modeled by introducing noise terms.  As a rather different example, in the same way that noisy Bayesian optimization (BO) can be used to find maximal sensor readings in a sensor network (e.g., see \cite{Kra11}), noisy BQ methods could be used to find average (or weighted average) readings.

We consider BQ methods that model uncertainty using a {\em Gaussian Process} (GP) with a suitable-chosen kernel.  In theoretical studies of GP methods, two distinct settings are commonly considered: Bayesian and non-Bayesian (i.e., frequentist).  In the Bayesian setting, the underlying function is assumed to be a random sample from a GP, whereas the non-Bayesian setting treats the function as fixed and unknown, assuming that it has a bounded norm in the {\em Reproducing Kernel Hilbert Space} (RKHS).  We will focus on the non-Bayesian setting, and specifically on the Mat\'ern-$\nu$ kernel, given by \cite{Ras06}
\begin{equation}
    k(\mathbf{x},\mathbf{x}') = \dfrac{2^{1-\nu}}{\Gamma(\nu)}
    \bigg(\dfrac{\sqrt{2\nu}\,r_{\mathbf{x},\mathbf{x}'}}{l}\bigg)^{\nu}  J_{\nu}\bigg(\dfrac{\sqrt{2 \nu}\,r_{\mathbf{x},\mathbf{x}'}}{l} \bigg), \label{eq:kMat}
\end{equation}
where $J_{\nu}$ is the modified Bessel function, $\Gamma$ is the gamma function, and $r_{\mathbf{x},\mathbf{x}'} = \|\mathbf{x} - \mathbf{x}'\|$.

In the noiseless setting, upper and lower bounds on the {\em worst-case} and {\em average-case} error (see Section \ref{sec:setup} for the definitions) have been given in various papers \cite{Bak59, Nov06, Nov16, Bac17, Kan16, Kan19, Wyn21}.  However, significantly less is known in the noisy setting.  In this work, we obtain both algorithmic upper bounds and algorithm-independent lower bounds for the noisy setting; our main results are informally summarized as follows.

{\bf Main Results (Informal).}  {\em Under the Mat\'ern kernel with parameter $\nu$ and dimension $d$ such that $\nu + d/2$ is integer-valued, the best possible noisy average-case error behaves as $\Theta(T^{-\frac{\nu}{d}-1} + \sigma T^{-\frac{1}{2}})$.}

We provide two distinct proofs for the lower bound of $\Omega(T^{-\frac{\nu}{d}-1} + \sigma T^{-\frac{1}{2}})$.  The first combines a noiseless $\Omega(T^{-\frac{\nu}{d}-1})$ lower bound \cite{Nov06} with a simple $\Omega(\sigma T^{-\frac{1}{2}})$ lower bound that arises from considering constant-valued functions.  The second proof considers a single subset of functions consisting of ``bumps'' whose signs are difficult to determine, and simultaneously attains both terms in a unified manner.   This approach is more technically challenging, but is useful for identifying a single source of difficulty, and may be more suitable when generalizing to other function classes.

Our upper bound builds on noiseless BQ techniques in \cite{Nov06} and techniques for noisy function estimation in \cite{Wyn21}.  Specifically, we use an estimate of the full function to construct an initial estimate $\hat{I}_1$ of the integral $I$, and then we use {\em Monte Carlo} (MC) sampling to estimate the residual $I - \hat{I}_1$.

In the following section, we further discuss our main result in the context of related existing works.

\section{Related Work}\label{sec:relate}

\begin{table*}[t!]
\renewcommand{2}{1.5}
    \begin{centering}
    \resizebox{0.8\linewidth}{!}{
        \begin{tabular}{|>{\centering}m{5.6cm}|>{\centering}m{4.5cm}|>{\centering}m{3.5cm}|}
            \hline
            & {\small \bf Upper Bounds} & {\small \bf Lower Bounds } \tabularnewline
            \hline

            \textbf{Noiseless Worst-Case} \cite{Nov06} & $O\big(T^{-\frac{\nu}{d}-\frac{1}{2}}\big)$ & $\Omega\big(T^{-\frac{\nu}{d}-\frac{1}{2}}\big)$ \tabularnewline
            \hline

            \textbf{Noiseless Average-Case} \cite{Nov06} & $O\big(T^{-\frac{\nu}{d}-1}\big)$ & $\Omega\big(T^{-\frac{\nu}{d}-1}\big)$ \tabularnewline
            \hline

            \textbf{Noisy Average-Case (Existing)} \\ (assuming $\sigma^2 = O(1)$) &  $\substack{ \text{(From \cite{Wyn21})}~~ O\big(T^{-\frac{2\nu+d}{4\nu+4d}}\big) \\ \text{(Monte Carlo)} ~~ O\big(T^{-\frac{1}{2}}\big)}$ & N/A \tabularnewline
            \hline

            \textbf{Noisy Average-Case (Ours)} & $O\big(T^{-\frac{\nu}{d}-1} + \sigma T^{-\frac{1}{2}}\big)$  & $\Omega\big(T^{-\frac{\nu}{d}-1} + \sigma T^{-\frac{1}{2}}\big)$ \tabularnewline
            \hline
        \end{tabular}
    }
    \par\end{centering}

    \protect\protect\caption{Summary of some of the most related existing results and our results; each entry gives the scaling of the BQ error for functions in the Matern-$\nu$ RKHS with dimension $d$ (assuming integer-valued $\nu+d/2$). \label{tab:compare}}
\end{table*}

Convergence properties of BQ methods have been extensively studied in prior works such as \cite{Bak59, Nov06, Nov16, Bac17, Kan16, Kan19, Wyn21}.  Several of these cast the function class in terms of Sobolev functions, which are norm-equivalent to Mat\'ern-$\nu$ RKHS functions when $s = \nu + d/2$ is integer-valued \cite{Kan18} (a condition we also adopt).  We adopt the RKHS viewpoint because we are particularly interested in GP methods.

For integer-valued $s$, the Sobolev function class of order $s$ is defined as
\begin{equation}
    W_2^s = \Big\{f\in L^2(\mathbb{R}^d): \sum_{\alpha \,:\, |\alpha| \le s} \|\partial^{\alpha}f\|_{L^2} < \infty\Big\}, \label{eq:sobolev}
\end{equation}
and the associated norm is given by
\begin{equation}\label{eq:sobnorm}
    \|f\|_{W_2^s} = \Big( \sum_{|\alpha| \le s} \|\partial^{\alpha}f\|_{L^2}^2 \Big)^{1/2},
\end{equation}
where each $\alpha$ is a $d$-dimensional multi-index with $|\alpha| = \sum_{i=1}^{d}\alpha_i$, and $\partial^{\alpha} f(\mathbf{x}) = \frac{\partial^{\alpha_1}}{\partial_{\mathbf{x}_1}}\frac{\partial^{\alpha_2}}{\partial_{\mathbf{x}_2}}\cdots\frac{\partial^{\alpha_d}}{\partial_{\mathbf{x}_d}} f(\mathbf{x})$.  The equivalence of the Sobolev class and Mat\'ern RKHS class with integer-valued $\nu+d/2$ can be found, for example, in \cite{Kan18}, and is summarised in Appendix \ref{sec:sobolev}.

Early literature such as \cite{Bak59}
proved that in the noiseless setting, the best possible worst-case (deterministic) error is $\Theta(T^{-\frac{\nu}{d}-\frac{1}{2}})$, whereas by considering the average-case error of a randomized algorithm, this can be reduced to $\Theta(T^{-\frac{\nu}{d}-1})$ \cite{Nov06}.  An extensive survey of the noiseless setting can be found in \cite{Nov06}, where it is also noted that Monte Carlo methods attain $O\big(\frac{1}{\sqrt T}\big)$ error; this observation readily extends to the noisy setting with $\sigma = O(1)$.

In the noisy setting, a particularly related work is \cite{Wyn21}, which considers estimating the function in $L^2$-norm.  This turns out to be a sufficient condition for estimating the integral in our setting, but not a necessary one, making the resulting BQ error bound of $O(T^{-\frac{2\nu+d}{4\nu+4d}})$ suboptimal when applied to the noisy BQ problem.

In contrast, in the noiseless setting, is is known that BQ with non-adaptive sampling, in the {\em worst case} (with respect to the function $f(\mathbf{x})$ {\em and} the $L^2$-bounded weighting function $p(\mathbf{x})$; see \eqref{eq:integral0}), is equivalent to estimating the function in $L^2$ norm \cite{Bac17}.  Such an equivalence does not hold in our setting, since (i) the random noise naturally lends itself to an average-case criterion, and (ii) we are interested in general choices of $p(\mathbf{x})$, and our hardness results will consider $p(\mathbf{x})=1$ (the equivalence in \cite{Bac17} does not apply under this choice).

We note that \cite{Wyn21} (as well as the earlier work of \cite{Kan16}) has the notable feature of considering misspecification with respect to the RKHS (e.g., assuming a different $\nu$ value to the true one), but we will focus on the well-specified case.

Having introduced the related works, we now discuss our results in more detail:
\begin{itemize}
    \item When $\sigma$ is constant, we find that simple Monte Carlo estimation is order-optimal.
    \item When $\sigma>T^{-\frac{\nu}{d}-\frac{1}{2}}$ and $\sigma = o(1)$, the scaling reduces to $\sigma T^{-\frac{1}{2}}$, which strictly improves on Monte Carlo.
    \item If $\sigma<T^{-\frac{\nu}{d}-\frac{1}{2}}$, then Monte Carlo sampling is again strictly suboptimal, and the difficulty of the problem matches the noiseless setting up to constant factors.
    \item The bound in \cite{Wyn21} is  suboptimal in view of the fact that $\frac{2\nu+d}{4\nu+4d}<\frac{1}{2}<\frac{\nu}{d}+1$, but in fairness, their work also handles the more difficult problem of estimating the entire function in $L^2$-norm.
\end{itemize}
Our results and the most relevant existing ones are summarized in Table \ref{tab:compare}.

The extensive literature on {\em Bayesian Optimization} (BO) is also related to our work.  However, BO turns out to be a strictly harder problem.  As surveyed in detail in the noiseless setting in \cite{Nov06}, noiseless BO is closely related to estimating the function in $L^{\infty}$ norm, and noiseless BQ is closely related to estimating it in $L^2$ norm, with the former being strictly harder.  Viewed differently, a key difficulty in BO is identifying a single short and narrow ``bump'' \cite{Bul11,Sca17a}, whereas in BQ the same bump contributes a negligible amount to the integral.

To further connect the two problems, in Appendix \ref{app:max_var}, we analyze the error of maximum variance sampling algorithm using techniques from BO literature. We obtain an upper bound of $O\big(T^{-\frac{\nu}{2\nu+d}}\big)$ (see Theorem \ref{thm:max-var-upper}), which is significantly weaker than our main upper bound result.  Thus, while BO techniques can indeed be adapted to BQ, doing so gives highly suboptimal bounds.

Finally, recent works on BQ have explored more sophisticated techniques and variations such as adaptive sampling \cite{Kan19}, active area search \cite{Ma14}, and settings with multiple related functions \cite{Ges19} (among many others), but we are not aware of any (beyond those outlined above) that are directly related to our study of theoretical error bounds in the standard noisy setting.

\section{Problem Setup} \label{sec:setup}

Let $f:D\rightarrow\mathbb{R}$ be a real-valued function on the compact domain $D=[0,1]^d$.  By shifting and scaling, our results readily extend to arbitrary rectangular domains.  In addition, our upper bounds easily extend to general compact domains.

We consider the class $\mathcal{F}_k(B)$ of functions whose RKHS norm $\|\cdot\|_k$ is upper bounded by some constant $B>0$.  We focus in particular on the Mat\'ern kernel (see \eqref{eq:kMat}) with parameters such that $\nu + d/2$ is integer-valued.  This is done so that the function class $\mathcal{F}_k(B)$ is equivalent to the Sobolev class given in \eqref{eq:sobolev} (see Appendix \ref{sec:sobolev} for details), allowing us to utilize useful auxiliary results on Sobolev functions.

Let $p(\mathbf{x})$ be a known and bounded density function, i.e., $p(\mathbf{x}) \in [0,p_{\max}]$ for some $p_{\max} > 0$, and $\int p(\mathbf{x})d\mathbf{x}=1$.  We define $\mathcal{P}(p_{\max})$ to be the set of all functions satisfying these conditions. Our goal is to estimate the integral of an RKHS function $f:D\rightarrow \mathbb{R}$ weighted by $p(\mathbf{x})$:
\begin{equation}
    I(f) = \int f(\mathbf{x})p(\mathbf{x})d\mathbf{x}. \label{eq:integral}
\end{equation}
Before forming an approximation of this integral, the algorithm takes $T$ observations: At time step $t$, select $\mathbf{x}_t\in D$, and observe $y_t=f(\mathbf{x}_t)+z_t$ with $z_t\sim N(0,\sigma^2)$.  The final approximate integral is denoted by $\hat{I}$.

As is commonly done for RKHS functions, we will use Bayesian methods based on a GP prior ${\rm GP}(0,k)$.  After observing $t$ noisy samples, the posterior distribution is also a GP with the following posterior mean and variance:
\begin{align}
    \mu_{t}(\mathbf{x}) &= \mathbf{k}_t(\mathbf{x})^T\big(\mathbf{K}_t + \lambda \mathbf{I}_t \big)^{-1} \mathbf{y}_t,  \label{eq:posterior_mean} \\
    \sigma_{t}^2(\mathbf{x}) &= k(\mathbf{x},\mathbf{x}) - \mathbf{k}_t(\mathbf{x})^T \big(\mathbf{K}_t + \lambda \mathbf{I}_t \big)^{-1} \mathbf{k}_t(\mathbf{x}), \label{eq:posterior_variance}
\end{align}
where $\mathbf{y}_t = [y_1,\ldots,y_t]^T$, $\mathbf{k}_t(\mathbf{x}) = \big[k(\mathbf{x}_i,\mathbf{x})\big]_{i=1}^t$, $\mathbf{K}_t = \big[k(\mathbf{x}_t,\mathbf{x}_{t'})\big]_{t,t'}$ is the kernel matrix, $\mathbf{I}_t$ is the identity matrix of dimension $t$, and $\lambda>0$ is a real number.  We assume that the variance is known, and accordingly take $\lambda=\sigma^2$ except where stated otherwise.

We consider both adaptive algorithms (i.e., the algorithm observes $y_1,\dotsc,y_{t-1}$ before choosing $\mathbf{x}_t$) and non-adaptive algorithms (i.e., all $\mathbf{x}_1,\dotsc,\mathbf{x}_T$ are chosen in advance).  In fact, we will prove our lower bound for adaptive algorithms and our upper bound for a non-adaptive algorithm, thus establishing that there is no adaptivity gap (up to constant factors).

Using the shorthands $\mathcal{F} = \mathcal{F}_k(B)$ and $\mathcal{P} = \mathcal{P}(p_{\max})$, the settings in Table \ref{tab:compare} are summarized as follows, the last of which is the one we focus on:
\begin{itemize}
    \item {\bf Noiseless Worst-Case Error:} $\mathcal{E}^{\rm wst}(T) = \sup_{p \in \mathcal{P}, f\in \mathcal{F}} |I -\hat{I}|$.
    \item {\bf Noiseless Average-Case Error:} $\mathcal{E}^{\rm avg}(T) = \sup_{p \in \mathcal{P}, f\in \mathcal{F}} \mathbb{E}\big[ |I - \hat{I}| \big]$, where the expectation is over the randomized algorithm.
    \item {\bf Noisy Average-Case Error:} $\mathcal{E}^{\rm avg}(T,\sigma) = \sup_{p \in \mathcal{P}, f\in \mathcal{F}} \mathbb{E}\big[ |I - \hat{I}| \big]$, where the expectation is over the randomized algorithm and the noise.
\end{itemize}
We have omitted a notion of worst-case error for the noisy setting, since there are subtle issues in posing such a setting in a meaningful manner.  For instance, even if the algorithm is deterministic given the noisy observations, it can still obtain randomness by taking digits after the 1000th decimal point (say) of the observed values $y_t$.  That is, the randomness from the noise alone could still give the same effect as using a randomized algorithm.

\section{Lower Bound}

The following lower bound for the noiseless setting (i.e, $\sigma^2 = 0$) has been obtained in existing works.  For completeness, we translate it into our notation and present a short proof in Appendix \ref{app:noiseless_lower}.  Here and subsequently, the kernel parameters $\nu,l$, dimension $d$, and RKHS norm $B$ are all treated as constants, and we consider the limit $T \to \infty$.

\begin{thm}\label{thm:noiseless_lower}
    {\em (Noiseless Lower Bound -- \citep[Theorems 1 \& 3]{Nov06}) }
    Consider the noiseless problem setup with constant parameters $(B,\nu,d,l)$ satisfying $\nu+\frac{d}{2}\in\mathbb{N}^{+}$, and time horizon $T$.  Then,  for any algorithm (possibly adaptive) for estimating $I$ in the noiseless setting, we have the following lower bounds:
    \begin{enumerate}
        \item The worst-case error is
        \begin{equation*}
            \mathcal{E}^{\rm wst}(T) = \Omega(T^{\frac{\nu}{d}-\frac{1}{2}}).
       \end{equation*}
        \item The average-case error is
        \begin{equation}
            \mathcal{E}^{\rm avg}(T) = \Omega(T^{\frac{\nu}{d}-1}).
       \end{equation}
    \end{enumerate}
    Moreover, these lower bounds hold even under the fixed weight function $p(\mathbf{x}) = 1$.
\end{thm}

Our lower bound for the noisy setting is stated as follows; note that we allow $\sigma$ to vary with $T$.

\begin{thm}\label{thm:noisy_lower}
    {\em (Average-Case Noisy Lower Bound)}
    Consider our problem setup with constant parameters $(B,\nu,d,l)$ satisfying $\nu+\frac{d}{2}\in\mathbb{N}^{+}$, noise variance $\sigma^2$, and time horizon $T$.  Then, for any algorithm (possibly adaptive and/or randomized) for estimating $I$, we have the following lower bound on the average-case error:
    \begin{equation}
        \mathcal{E}^{\rm avg}(T,\sigma) = \Omega(T^{\frac{\nu}{d}-1} + \sigma T^{-\frac{1}{2}}). \label{eq:lb_statement}
    \end{equation}
    Moreover, this lower bound holds even under the fixed weight function $p(\mathbf{x}) = 1$.
\end{thm}

Since the first term in \eqref{eq:lb_statement} follows directly from Theorem \ref{thm:noiseless_lower}, it suffices to establish the second term; we do so in the following section by considering constant-valued functions.  On the other hand, it is also of interest to establish a single hard subset of functions that yields both terms in \eqref{eq:lb_statement} in a unified manner, thus establishing a single source of difficulty for both terms.  We provide such an approach in  Appendix \ref{app:lowerboundproof}, considering functions composed of several small ``bumps''.  The idea is that with too few samples the algorithm cannot reliably determine which bumps are positive and which are negative, and if too many of these are uncertain, then a certain level of error is unavoidable.

\subsection{Simple Derivation of the Second Term in Theorem \ref{thm:noisy_lower}}

We show that our function class contains all functions that are constant-valued over the domain $[0,1]^d$, when that constant $c$ is restricted to be sufficiently small.  Under this restricted function class, any observations are simply sampling from $N(c,\sigma^2)$, and the BQ problem reduces to one-dimensional {\em Gaussian Mean Estimation}.  This is a very standard problem for which it is known that the optimal error rate is $\Theta(\sigma T^{-\frac{1}{2}})$ (e.g., see \cite{Tsy09}).

To show that constant functions lie in our function class, we first consider the following ``bump'' function used in earlier works, e.g., see \citep[Lemma 5]{Bul11} and \citep[Lemma 4]{Cai20}.

\begin{lem} \label{lem:bounded_bump}
    {\em (Bounded-Support Function Construction \citep[Lemma 5]{Bul11}, \citep[Lemma 4]{Cai20})}
    Let $h_0(\mathbf{x}) = \exp\big( \frac{-1}{1-\|\mathbf{x}\|^2} \big) \mathds{1}\{ \|\mathbf{x}\|_2 < 1 \}$ be the $d$-dimensional bump function, and let $h(\mathbf{x}) = \frac{c}{h(\boldsymbol{0})} h_0\big(\frac{\mathbf{x}}{w}\big)$ be the re-sacled version of $h_0$ for some $w > 0$ and $c > 0$. Then, $h$ satisfies the following properties:
    \begin{itemize}[leftmargin=8ex,itemsep=0ex,topsep=0.2ex]
        \item $h(\mathbf{x}) = 0$ for all $\mathbf{x}$ outside the $\ell_2$-ball of radius $w$ centered at the origin;
        \item $h(\mathbf{x}) \in [0,c]$ for all $\mathbf{x}$, and $h(\boldsymbol{0}) = c$.
        \item $\| h \|_k \le c_1\frac{c}{h(0)} \big(\frac{1}{w}\big)^{\nu} \|h_0\|_k$ when $k$ is the Mat\'ern-$\nu$ kernel on $\mathbb{R}^d$, where $c_1$ is constant.  In particular, we have $\| h \|_k \le B$ when $w = \big( \frac{ c c_1 \|h_0\|_k }{ h_0(\boldsymbol{0}) B } \big)^{1/\nu}$.
    \end{itemize}
\end{lem}

To produce a constant-valued function, we can convolve this bump function with a function that is flat within a ball, namely, ${\rm Ball}(\mathbf{x}) = \mathds{1}\{\|\mathbf{x}\| \le r\}$ for some $r>0$.  We can choose $r > \sqrt{d}$ to ensure that all of $[0,1]^d$ is covered, and although ${\rm Ball}(\mathbf{x})$ is not in the RKHS, the resulting convolved function is.  Formally, we have the following.

\begin{lem} \label{lem:constant_function}
     {\em (Constant-valued RKHS Function \citep[Lemma 6]{Cai20})} Let $k$ be the Mat\'ern-$\nu$ kernel on $\mathbb{R}^d$, let $r > 0$ and $0 < w_0 \le \frac{r}{2}$ be fixed constants, and let $c > 0$ and $B > 0$ be such that $\frac{c}{B}$ is sufficiently small.  There exists a function $f(\mathbf{x})$ on $\mathbb{R}^d$ satisfying $f(\mathbf{x}) = c$ whenever $\|\mathbf{x}\|_2 \le r-w_0$, and $\|f\|_k\le B$.
\end{lem}

We now have the desired constant-valued function by noting that restricting a function from $\mathbb{R}^d$ to $[0,1]^d$ does not increase the corresponding RKHS norm \cite{Aro50}.  No matter how small the value of $B > 0$, all sufficiently small $c$ are allowed according to Lemma \ref{lem:constant_function}, and this is all that is needed for the above-mentioned $\Theta(\sigma T^{-\frac{1}{2}})$ scaling to hold (in fact, the lower bound holds even when the maximum allowed $c$ decreases sufficiently slowly with $T$, but we do not require this fact).

\section{Upper Bound}

In this section, we introduce a non-adaptive algorithm and derive an upper bound on the average error that matches our algorithm-independent lower bound up to constant factors.  We follow the high-level idea of combining function estimation methods with Monte Carlo estimation on the residual, previously proposed for the noiseless setting \cite{Nov06}, but with significantly different details to account for the noise.

\subsection{Algorithm and  Main Result}

\begin{algorithm}[!t]
	\caption{Two-batch integral estimation algorithm}  \label{alg:two-phase-bq}
	\begin{algorithmic}[1]
		\STATE {\bfseries Input:} Domain $D$, GP prior ($\mu_0$, $k_0$), time horizon $T$.
		\FOR{$t=1,\dots,T/2$}
			\STATE Select $\mathbf{x}_t=\argmax_{\mathbf{x}\in D}\sigma_{t-1}(\mathbf{x})$.
			\STATE Receive $y_t=f(\mathbf{x}_t)+\epsilon_t$.
			\STATE Update $\sigma_t$ using $\mathbf{x}_1,\dotsc,\mathbf{x}_t$.
		\ENDFOR
		\STATE Update $\mu_{T/2}(\mathbf{x})$ using $\mathbf{x}_1,\dots,\mathbf{x}_{T/2},y_1,\dots,y_{T/2}$.
		\FOR{$t=T/2+1,\dots,T$}
			\STATE Sample $\mathbf{x}_t \sim p(\mathbf{x})$ independently.
			\STATE Receive $y_t=f(\mathbf{x}_t)+\epsilon_t$
		\ENDFOR
		\STATE Compute the approximate integral $\hat{I}_1=\int_D p(\mathbf{x}) \mu_{T/2}(\mathbf{x})d\mathbf{x}$
		\STATE Compute the residual $\hat{R}=\frac{2}{T}\sum_{t=T/2 + 1}^{T} (y_t-\mu_{T/2}(\mathbf{x}_t))$
		\STATE Output $\hat{I} = \hat{I}_1+\hat{R}$
	\end{algorithmic}
\end{algorithm}

We consider the algorithm shown in Algorithm \ref{alg:two-phase-bq}, and described as follows.  The samples are performed in two batches, but still in a non-adaptive manner (i.e., the second batch can be chosen without knowing the first batch).  In the first batch, we run maximum variance sampling\footnote{We focus on maximum variance sampling for concreteness, but our analysis and results are unchanged when, at time $t$, an arbitrary point satisfying $\sigma_{t-1}(\mathbf{x})\geq \gamma\lVert\sigma_{t-1}\rVert_{L^\infty}$ is found for some $\gamma \in (0,1)$ (e.g., $\gamma = \frac{1}{2}$).  This requirement is potentially much easier to attain in practice, instead of insisting on the global maximum.} and use the resulting $T/2$ samples to construct an estimate $\mu_{T/2}$ of $f$.  Note that these $T/2$ samples are non-adaptive, because the posterior variance of a GP does not depend on any observations.

We consider the initial estimate $\hat{I}_1=\int_D p(\mathbf{x}) \mu_{T/2}(\mathbf{x})d\mathbf{x}$, and let the residual $R$ denote the difference between the true integral and this value:
\begin{equation} \label{eq:residual}
    R=I-\hat{I}_1=\int_D p(\mathbf{x}) (f(\mathbf{x})-\mu_{T/2}(\mathbf{x}))d\mathbf{x}.
\end{equation}
Having fixed $\mu_{T/2}$ and hence $\hat{I}_1$, we can refine our overall estimate of $I$ by estimating the residual $R$. To do so, we use the last $T/2$ samples to construct a Monte Carlo estimator $\hat{R}$ of $R$, i.e., $\hat{R}=\frac{2}{T}\sum_{t=T/2+1}^{T} (y_t-\mu_{T/2}(\mathbf{x}_t))$, in which each $\mathbf{x}_t$ is sampled from $p(\mathbf{x})$.

\begin{thm} \label{thm:upper}
    {\em (Average-Case Noisy Upper Bound)}
    Consider our problem setup with constant parameters $(B,\nu,d,l,p_{\max})$ satisfying $\nu+\frac{d}{2}\in\mathbb{N}^{+}$, noise variance $\sigma^2$, and time horizon $T$.  For any fixed $f\in\mathcal{F}_l(B)$ and $p \in \mathcal{P}(p_{\max})$, the average cumulative error (averaged over the noisy samples and the randomness of the algorithm) incurred by Algorithm \ref{alg:two-phase-bq} satisfies
    \begin{equation}
        \mathbb{E}\big[ |\hat{I}-I| \big] = O\Big(T^{-\frac{\nu}{d}-1}+T^{-\frac{1}{2}}\sigma\Big).
    \end{equation}
\end{thm}
As discussed in Section \ref{sec:relate}, this matches our lower bound up to constant factors, and shows that the overall difficulty of noisy BQ is as roughly hard as either noiseless BQ or univariate Gaussian mean estimation with variance $\sigma^2$ (whichever is harder). Our \emph{non-adaptive} algorithm's upper bound matches our lower bound for any \emph{adaptive} algorithms also establishes that there is no adaptivity gap in term of scaling laws on the mean absolute error of noisy BQ.

\subsection{Proof of Theorem \ref{thm:upper}}

The mean squared error (MSE) between the true integral and the output of the algorithm is given by
\begin{align}\label{eq:alg-mse}
    &\mathbb{E}\Big[(I-\hat{I}_1-\hat{R})^2\Big]=\mathbb{E}\Big[\Big(\int_D p(\mathbf{x}) f(\mathbf{x})d\mathbf{x} \nonumber \\
    & - \int_D p(\mathbf{x}) \mu_{T/2}(\mathbf{x})d\mathbf{x}
    - \frac{2}{T}\sum_{t=T/2+1}^{T} \big(y_t-\mu_{T/2}(\mathbf{x}_t)\big)\Big)^2\Big]
\end{align}
We will use guarantees on the initial estimate $\hat{I}_1$ from \cite{Wyn21}, and accordingly, we first treat $\hat{I}_1$ as being fixed (i.e., we condition on the outcomes from the first batch) and study the residual estimator $\hat{R}$.

\begin{lem} \label{lem:R-mean}
    Condition on arbitrary fixed values of $y_1,\dotsc,y_{T/2}$ (and hence, fixed $\hat{I}_1$ and $R$), and consider the resulting distribution of $\hat{R}$ due to the randomness in $\mathbf{x}_{T/2+1},\dotsc,\mathbf{x}_T$ and $\epsilon_{T/2+1},\dotsc,\epsilon_T$.  Then,  $\hat{R}$ is a conditionally unbiased estimator of the residual $R$, i.e., $\mathbb{E}[\hat{R}]=R$ (with implicit conditioning).
\end{lem}
\begin{proof}
We have
{\allowdisplaybreaks
\begin{align*}
	\mathbb{E}[\hat{R}]
	&=\mathbb{E}\Big[\dfrac{2}{T}\sum_{t=T/2+1}^{T} \big(y_t-\mu_{T/2}(\mathbf{x}_t)\big)\Big] \\
	&=\dfrac{2}{T}\sum_{t=T/2+1}^{T} \mathbb{E}[y_t-\mu_{T/2}(\mathbf{x}_t)] \\
	&=\dfrac{2}{T}\sum_{t=T/2+1}^{T} \mathbb{E}[f(\mathbf{x}_t)-\mu_{T/2}(\mathbf{x}_t)+\epsilon_t] \\
	&=\dfrac{2}{T}\sum_{t=T/2+1}^{T} \mathbb{E}[f(\mathbf{x}_t)-\mu_{T/2}(\mathbf{x}_t)] \\
	&=\dfrac{2}{T}\sum_{t=T/2+1}^{T} \int_D p(\mathbf{x}) [f(\mathbf{x})-\mu_{T/2}(\mathbf{x})]d\mathbf{x} \\
	&=\int_D p(\mathbf{x}) [f(\mathbf{x})-\mu_{T/2}(\mathbf{x})]d\mathbf{x} = R,
\end{align*}}
where the second equality is due to the linearity of expectation, the fourth equality is due to $\epsilon_t\sim N(0,\sigma^2)$, and the fifth equality holds since $\mathbf{x}_t \sim p(\mathbf{x})$.
\end{proof}

In addition, the variance of the residual estimator $\hat{R}$ is bounded according to the following.

\begin{lem} \label{lem:R-var}
    Under the setup of Lemma \ref{lem:R-mean}, we have
    \begin{equation}
        \mathrm{Var}[\hat{R}] \leq \dfrac{4p_{\max}}{T} \lVert f - \mu_{T/2} \rVert_{L^2}^2 + \dfrac{2\sigma^2}{T}, \label{eq:Rvar}
    \end{equation}
    where the variance is with respect to the randomness in $\mathbf{x}_{T/2+1},\dotsc,\mathbf{x}_T$ and $\epsilon_{T/2+1},\dotsc,\epsilon_T$.
\end{lem}
\begin{proof}
We have
\begin{align}
	\mathrm{Var}[\hat{R}] &=\mathrm{Var}\Big[\dfrac{2}{T}\sum_{t=T/2+1}^{T} \big(y_t-\mu_{T/2}(\mathbf{x}_t)\big)\Big] \nonumber \\
	&=\dfrac{4}{T^2}\sum_{t=T/2+1}^{T}\mathrm{Var}[y_t-\mu_{T/2}(\mathbf{x}_t)] \nonumber \\
	&=\dfrac{4}{T^2}\sum_{t=T/2+1}^{T}\mathrm{Var}[f(\mathbf{x}_t)-\mu_{T/2}(\mathbf{x}_t)+\epsilon_t] \nonumber \\
	&=\dfrac{4}{T^2}\sum_{t=T/2+1}^{T}\mathrm{Var}[f(\mathbf{x}_t)-\mu_{T/2}(\mathbf{x}_t)] \nonumber \\
	 & \hspace*{3cm} +\dfrac{4}{T^2}\sum_{t=T/2+1}^{T}\mathrm{Var}[\epsilon_t] \nonumber \\
	&=\dfrac{4}{T^2}\sum_{t=T/2+1}^{T}\mathrm{Var}[f(\mathbf{x}_t)-\mu_{T/2}(\mathbf{x}_t)] + \dfrac{2\sigma^2}{T}, \label{eq:var-1}
\end{align}
where the second equality is due to the independence of $\mathbf{x}_t$ for different $t$ (and similarly for $\epsilon_t$), and the final two inequalities hold since $\epsilon_t\sim N(0,\sigma^2)$ with independence from $\mathbf{x}_t$ and $f$.  Moreover, by the definition of variance, we have
\begin{align}
	\mathrm{Var} &[f(\mathbf{x}_t)-\mu_{T/2}(\mathbf{x}_t)] \nonumber \\
	&= \mathbb{E}[(f(\mathbf{x}_t)-\mu_{T/2}(\mathbf{x}_t))^2] - \mathbb{E}[f(\mathbf{x}_t)-\mu_{T/2}(\mathbf{x}_t)]^2 \nonumber \\
	&\leq \mathbb{E}[(f(\mathbf{x}_t)-\mu_{T/2}(\mathbf{x}_t))^2] \nonumber \\
	&= \int_D p(\mathbf{x}) (f(\mathbf{x})-\mu_{T/2}(\mathbf{x}))^2 d\mathbf{x} \nonumber \\
	&\leq p_{\max} \lVert f - \mu_{T/2} \rVert_{L^2}^2, \label{eq:var-2}
\end{align}
where the last inequality is due to our assumption that $p(\mathbf{x}) \in [0,p_{\max}]$ for all $\mathbf{x}$. Substituting \eqref{eq:var-2} into \eqref{eq:var-1}, we obtain \eqref{eq:Rvar} as desired.
\end{proof}
We can now analyze the MSE of our algorithm averaged over {\em all} samples, including the first $T/2$.  Let $\mathbb{E}_1[\cdot]$ (respectively, $\mathbb{E}_2[\cdot]$) denote averaging with respect to the randomness from the first (respectively, second) batch.  We first note that conditioned on the first $T/2$ samples, we have
\begin{align}
    \mathbb{E}_2\Big[\big(I-\hat{I}_1-\hat{R}\big)^2\Big]
    &= \mathbb{E}_2\Big[\big(R-\hat{R}\big)^2\Big] \nonumber \\
    &= \mathbb{E}_2\Big[\big(\mathbb{E}_2[\hat{R}] - \hat{R}\big)^2\Big] \nonumber \\
    &= \mathrm{Var}[\hat{R}] \nonumber \\
    &\leq \dfrac{4p_{\max}}{T} \lVert f - \mu_{T/2} \rVert_{L^2}^2 + \dfrac{2\sigma^2}{T}, \label{eq:mse0}
\end{align}
where the second equality holds since $\mathbb{E}_2[\hat{R}]=R$ (see Lemma \ref{lem:R-mean}), and the last step is due to Lemma \ref{lem:R-var}.

Then, incorporating the randomness from the first $T/2$ samples, we obtain
\begin{align}
    \mathbb{E}\Big[\big(I-\hat{I}_1-\hat{R}\big)^2\Big]
        &= \mathbb{E}_1\bigg[\mathbb{E}_2\Big[\big(I-\hat{I}_1-\hat{R}\big)^2\Big]\bigg] \nonumber \\
        &\le \dfrac{4p_{\max}}{T} \mathbb{E}\Big[ \lVert f - \mu_{T/2} \rVert_{L^2}^2 \Big] + \dfrac{2\sigma^2}{T}, \label{eq:mse}
\end{align}
where we applied the tower property of expectation, followed by \eqref{eq:mse0} (note that $\mathbb{E}_1\big[ \lVert f - \mu_{T/2} \rVert_{L^2}^2 \big] = \mathbb{E}\big[ \lVert f - \mu_{T/2} \rVert_{L^2}^2 \big]$ since no quantities from the second batch are present).

It remains to upper bound the mean $L^2$ error $\mathbb{E}\left[\lVert f-\mu_{T/2} \rVert_{L^2}\right]$ between the true function $f$ and the estimate $\mu_{T/2}$.  To do, we use the following result, which is implicit in \cite{Wyn21}.

\begin{lem} \label{lem:l2-error}
    {\em ($L^2$ Estimation Rate \citep[Corollary 5]{Wyn21})}
    Letting $\mu_{T/2}$ be the estimate of the true function $f$ obtained in Algorithm \ref{alg:two-phase-bq}, we have
    \begin{equation}
        \mathbb{E}[\lVert f-\mu_{T/2} \rVert_{L^2}^2] \\ = O\bigg(\Big(\Big(\dfrac{T}{2}\Big)^{-\frac{\nu}{d}-\frac{1}{2}}+\sigma\Big)^2\bigg),
    \end{equation}
    where the expectation is taken with respect to the random noise terms $\epsilon_{1},\dots,\epsilon_{T/2}$.
\end{lem}
The details on how to obtain Lemma \ref{lem:l2-error} using the results of \cite{Wyn21} are presented in Appendix \ref{app:proof-lem-l2-error}. Substituting the result of Lemma \ref{lem:l2-error} into \eqref{eq:mse}, we obtain
\begin{align*}
    &\mathbb{E}\Big[ (I-\hat{I}_1-\hat{R})^2\Big]
    \leq \dfrac{4p_{\max}}{T} \mathbb{E}[\lVert f - \mu_{T/2} \rVert_{L^2}^2] + \dfrac{2\sigma^2}{T} \\
    &\hspace*{-1ex}=O\bigg(\dfrac{1}{T}\Big(\Big(\dfrac{T}{2}\Big)^{-\frac{\nu}{d}-\frac{1}{2}}+\sigma\Big)^2 + \dfrac{\sigma^2}{T}\bigg), \\
    &\hspace*{-1ex}= O\bigg(\Big(\dfrac{1}{\sqrt{T}}\Big(\dfrac{T}{2}\Big)^{-\frac{\nu}{d}-\frac{1}{2}}+\dfrac{\sigma}{\sqrt{T}}\Big)^2\bigg) \\
    &\hspace*{-1ex}= O\bigg(\Big(T^{-\frac{\nu}{d}-1}+\sigma T^{-\frac{1}{2}}\Big)^2\bigg).
\end{align*}
Finally, we write
\begin{align}
    \mathbb{E}\big[|I-\hat{I}_1-\hat{R}|\big]
        &\le \sqrt{\mathbb{E}\Big[(I-\hat{I}-R)^2\Big]}\\
        &= O\Big(T^{-\frac{\nu}{d}-1}+\sigma T^{-\frac{1}{2}}\Big),
\end{align}
where the fist step follows from Jensen's inequality.  Since we have proved this for any $f \in \mathcal{F}_k(B)$ and $p \in \mathcal{P}(p_{\max})$, the proof of Theorem \ref{thm:upper} is complete.

\section{Experiments}

In this section, we conduct simulation studies to compare our two-batch algorithm with its component parts, maximum variance sampling (MVS) and Monte Carlo sampling (MC).  We refer to our algorithm, Algorithm \ref{alg:two-phase-bq}, as MVS-MC.  Our goal is not to establish state-of-the-art performance, but instead to support our theory and also highlight its potential practical limitations.

To attain a better understanding of how MVS-MC performs with respect to time, we modify it to {\em alternate} between MVS samples and MC samples, instead of doing all of one followed by all of the other.  Mathematically, this does not change the behavior at the {\em final} time step.

\subsection{Setup}
{\bf GP model.}  In accordance with our theoretical analysis, we use a GP with the Mat\'ern-$\nu$ kernel, adopting the common choice $\nu = 3/2$.  The lengthscale is left as a free parameter, as is an additional scale parameter that we introduce (multiplying \eqref{eq:kMat}) to permit functions with varying ranges.  Except where stated otherwise, these two parameters are learned by maximizing the data log-likelihood \cite{Ras06} using the built-in SciPy optimizer based on L-BFGS-B.  We seek to solve the BQ problem with a constant weight function, i.e., $p(\mathbf{x}) = 1$.

{\bf Evaluation.}  We compare MVS-MC against its two components, MVS and Monte Carlo. For MVS and MVS-MC, we perform 100 trials, with each trial using a distinct set of 3 random initial points (but these are common to both methods).  For MC, since every round is already randomized, we simply run 100 trials without initial points.  For all functions, we consider a time horizon of $T = 250$, and evaluate the performance using the mean absolute error, with the ground truth value being determined by the SciPy \textsc{nquad} function (without noise).  Error bars in our plots indicate $\pm 0.5$ standard deviation with respect to the 100 trials.

{\bf Other details.}  We compute the approximate integral $\hat{I}_1$ (see Line 12 of Algorithm \ref{alg:two-phase-bq}) using the SciPy \textsc{nquad} function if the dimension is one.  For higher dimensions, we approximate it using $10^5$ Monte Carlo iterations to avoid the potentially slow behavior of \textsc{nquad}.

\subsection{Results}

We provide a selection of our results here, and give a more complete set of results in Appendix \ref{app:addexp}.

\subsubsection{Synthetic Kernel-Based Functions}
We first simulate on a set of synthetic functions following the method of \cite{Jan20}, where each function is constructed by sampling $m=30d$ points, $\hat{\mathbf{x}}_1\ldots\hat{\mathbf{x}}_m$, uniformly on $[0,1]^d$, and $\hat{a}_1\ldots\hat{a}_m$ uniformly on $[-1,1]$.  The function is then defined as $f(\mathbf{x}) = \sum_{i=1}^{m} \hat{a}_i k(\hat{\mathbf{x}}_i, \mathbf{x})$.  The kernel scale, length-scale and smoothness parameter (i.e., $\nu$) are set to be $2$, $0.03$, and $3/2$ respectively.

We let MVS and MVS-MC know the kernel hyperparameters (i.e., we omit the kernel learning step here).  The results for $d \in \{2,4\}$ and $\sigma \in \{0.001,0.05\}$ are shown in Figure \ref{fig:synthetic}, and further $(d,\sigma)$ pairs are shown in Appendix \ref{app:addexp}.   We observe that MVS-MC and MC behave fairly similarly (however, see below for several examples where this is not the case), and while MVS can be slightly preferable at low noise, it suffers significantly at high noise.

\begin{figure}[!t]
\centering
    \begin{subfigure}{\columnwidth}
    \centering
    \includegraphics[width=0.3\linewidth]{figs/synthetic/syn2-0.001.pdf}
    \includegraphics[width=0.3\linewidth]{figs/synthetic/syn2-0.1.pdf}
    \end{subfigure}

    \vskip 0.1in

    \begin{subfigure}{\columnwidth}
    \centering
    \includegraphics[width=0.3\linewidth]{figs/synthetic/syn4-0.001.pdf}
    \includegraphics[width=0.3\linewidth]{figs/synthetic/syn4-0.1.pdf}
    \end{subfigure}

    \caption{Results for synthetic functions. \label{fig:synthetic}}
    \vspace*{-1.5ex}
\end{figure}

\subsubsection{Benchmark Functions}

We consider a variety of well-known benchmark functions, namely, Ackley, Alpine, Gramacy-Lee, Griewank and Rastrigin; see \cite{SFU_Funcs} for the descriptions.  The results for the Alpine1D and Ackley2D functions at two different noise levels are shown in Figure \ref{fig:benchmark}, and the rest are shown in Appendix \ref{app:addexp-noise}.

Here we see a clear trend of Monte Carlo suffering at low noise, MVS suffering at high noise, and MVS-MC performing well in both cases, consistent with our theory.  Thus, while MVS-MC does not perform best in each individual plot, it is generally able to attain the benefits of both MVS and MC, at least in these examples.

\begin{figure}[!t]
\centering
    \begin{subfigure}{\columnwidth}
    \centering
    \includegraphics[width=0.3\linewidth]{figs/benchmark/2d/ack2-0.001.pdf}
    \includegraphics[width=0.3\linewidth]{figs/benchmark/2d/ack2-0.05.pdf}
    \end{subfigure}

    \vskip 0.1in

    \begin{subfigure}{\columnwidth}
    \centering
    \includegraphics[width=0.3\linewidth]{figs/benchmark/1d/alp1-0.001.pdf}
    \includegraphics[width=0.3\linewidth]{figs/benchmark/1d/alp1-0.05.pdf}
    \end{subfigure}

    \caption{Results for benchmark functions. \label{fig:benchmark}}
    \vspace*{-1.5ex}
\end{figure}

\subsection{Effect of Split Size of MVS-MC} \label{sec:effect_split}

In our theoretical analysis and the preceding experiments, we let MVS-MC use half of the samples for each component (MVS and MC).  However, in practice, it may be beneficial to allow different splits.  In Figure \ref{fig:split-1}, we explore the effect of the split fraction, i.e., the fraction allocated to the MVS part.

The top row shows examples where there is a characteristic ``U'' shape, indicating that the MVS-MC is preferable to MVS or MC individually.  On the other hand, the bottom row indicates that the error may be monotonically decreasing (particularly at high noise) or increasing (particularly at low noise) with respect to the split fraction.

Further examples are shown in Appendix \ref{app:addexp-split}.  Overall, we found that an equal split is reasonable, though letting the split fraction be a free parameter can also be beneficial.

\begin{figure}[!t]
\centering
    \begin{subfigure}{\columnwidth}
    \centering
    \includegraphics[width=0.3\linewidth]{figs/splits/1d/split-alp1-0.001.pdf}
    \includegraphics[width=0.3\linewidth]{figs/splits/2d/split-ack2-0.01.pdf}
    \end{subfigure}

    \vskip 0.1in

    \begin{subfigure}{\columnwidth}
    \centering
    \includegraphics[width=0.3\linewidth]{figs/splits/1d/split-gl-0.05.pdf}
    \includegraphics[width=0.3\linewidth]{figs/splits/2d/split-gri2-0.001.pdf}
    \end{subfigure}

    \caption{Comparison of different MVS-MC splits, i.e., the fraction of rounds for which MVS is used. \label{fig:split-1}}
\end{figure}

\subsection{Sensor Measurement Data}

An additional experiment based on real-world sensor measurement data is given in Appendix \ref{app:addexp-sensor}, where we observe roughly similar behavior to the synthetic function results of Figure \ref{fig:synthetic}.

\section{Conclusion}

We have established tight scaling laws on the mean absolute error of noisy Bayesian quadrature for functions in an RKHS with Mat\'ern-$\nu$ kernel, showing a lower bound of $\Omega(T^{-\frac{\nu}{d}-1}+\sigma T^{-\frac{1}{2}})$ for any adaptive algorithm, and there exists a non-adaptive algorithm with a matching upper bound $O(T^{-\frac{\nu}{d}-1}+\sigma T^{-\frac{1}{2}})$. Thus, there is no adaptivity gap in terms of scaling laws.

Perhaps the most immediate direction for future work is to extend our results to other kernels, notably including (i) the Mat\'ern kernel with non-integer values of $\nu + d/2$, and (ii) the squared exponential kernel.  The former has the added difficulty of not being able to use the equivalence with the Sobolev class, and the latter has the added difficulty of not being able to use the bounded-support bump function (as it has infinite RKHS norm under the SE kernel).

Machine Learning (stat.ML); Information Theory (cs.IT); Machine Learning (cs.LG); Statistics Theory (math.ST)