SlowGuess/NeurIPS_2023_OCR huggingface dataset:
$$
\begin{array}{l} \mathbb {P} (c \in \mathcal {U} _ {\alpha} (z)) = \frac {1}{2} \mathbb {P} \left(r \geq - \frac {1 - \sqrt {2 - 2 \alpha}}{2} | z \geq 0\right) + \frac {1}{2} \mathbb {P} \left(r \leq \frac {1 - \sqrt {2 - 2 \alpha}}{2} | z <   0\right) \\ = \frac {1}{2} \mathbb {P} \left(r \geq - \frac {1 - \sqrt {2 - 2 \alpha}}{2}\right) + \frac {1}{2} \mathbb {P} \left(r \leq \frac {1 - \sqrt {2 - 2 \alpha}}{2}\right) \\ = \alpha , \\ \end{array}
$$
where the first line comes from the property of the conditional expectation, the second line comes from the fact that the distribution of the residual is independent of the sign of the covariate  $z$ , and the last line comes from (22).
Next, we show that the solution  $x(z)$  is the optimal solution of problem (5) with the uncertainty set  $\mathcal{U}_{\alpha}(z)$ . By (5) and the feasible set, we have that the optimal solution is 1 or -1 only when all elements in the uncertainty set are non-positive or non-negative, respectively, and the optimal solution is 0 when the uncertainty set contains both positive and negative numbers. Thus, we can find the result by computing the lower and upper bound of the uncertainty set  $\mathcal{U}_{\alpha}(z)$  for  $z \in [0,1]$  and  $z \in [-1,0)$ , respectively.
C Supplementary for Section 4
This section provides our algorithm and the corresponding analysis for Section 4. We first briefly summarize the problem and then, develop the DRO algorithm raised by our predict-then-calibrate framework and the detailed proof of the algorithm analysis.
As stated in Section 4, we here consider the risk-neutral problem (2) as follows
$$
\min  _ {x} \mathbb {E} [ c | z ] ^ {\top} x,
$$
instead of a risk-sensitive objective in Section 3. As stated in Section 2, we work on a well-trained ML prediction model  $\hat{f}$  that predicts the objective vector  $c$  based on the covariate  $z$ . Then, we will apply the idea of distributionally robust optimization to bound the prediction error and develop the generalization bound. We remark again that the prediction model can be any off-the-shelf machine learning method since we have no assumption about it.
C.1 DRO Algorithm
In this part, we derive the DRO algorithm from our predict-them-calibrate framework. As for Algorithms 1 and 2, we work on the prediction error
$$
r _ {t} = c _ {t} - \hat {f} (z _ {t})
$$
of all samples in the validation dataset  $\mathcal{D}_{val} = \{c_t, A_t, b_t, z_t\}_{t=1}^T$ . In the following, by a little abuse of notation, we use  $t \in \mathcal{D}_{val}$  to denote a sample tuple  $(c_t, A_t, b_t, z_t)$  in the validation set.
Algorithm 4 Contextual Distributionally Robust LP
1: Input: Dataset  $\mathcal{D}_{val}$ , ML model  $\hat{f}$ , radius  $\varepsilon$ , bandwidth  $h$ , target covariate  $z_0$
2: For each  $t \in \mathcal{D}_{val}$ , let
$$
r _ {t} := c _ {t} - f (z _ {t})
$$
3: Define the estimation of the conditional mean of residuals of covariate  $z_0$  by
$$
r _ {0} := \sum_ {t \in \mathcal {D} _ {v a l}} w _ {t} (z _ {t}, z _ {0}) r _ {t},
$$
$$
w _ {t} (z) \propto K ((z _ {t} - z _ {0}) / h), \sum_ {t \in \mathcal {D} _ {v a l}} w _ {t} (z) = 1
$$
and  $K(z)$  is a kernel function that satisfies Assumption 3
4: Construct the degenerate ambiguity set by
$$
\Xi = \left\{r ^ {\prime}: \| r ^ {\prime} - r _ {0} \| _ {2} \leq \varepsilon \right\}
$$
5: Solve the degenerate distributional robust optimization problem
$$
\hat {x} (z _ {0}) = \arg \min  _ {x} \sup  _ {r \in \Xi} (f (z) + r) ^ {\top} x,
$$
6: Output:  $\hat{x}(z_0)$
The main idea of our algorithm is similar to distributionally robust optimization that consists of two steps: firstly, construct an ambiguity set  $\Xi$ , and secondly, solve the following distributionally robust LP:
$$
\min  _ {x} \max  _ {\mathcal {P} ^ {\prime} \in \Xi} \mathbb {E} _ {\mathcal {P} ^ {\prime}} \left[ (\hat {f} (z) + r) ^ {\top} x \right], \tag {23}
$$
$$
\begin{array}{l} \text {s . t .} A x \leq b, x \geq 0, \end{array}
$$
and use its optimal solution to solve (2). If the ambiguity set contains the target distribution, say  $\mathcal{P}_{r|z_0}$ , we can obtain a good solution to (2) by solving (23) with some generalization bound. Here,  $\mathcal{P}_{r|z}$  denotes the distribution of the prediction error given the covariate  $z$ . In our case, specifically, the ambiguity set can degenerate into a set consisting of the mean of distributions in the ambiguity set since we only focus on the estimation of the conditional mean  $\mathbb{E}[r|z_0]$  for the target covariate  $z_0$ . Thus, in the following, we will also use  $\Xi$  to denote a set of vectors corresponding to the means of
the distributions in  $\Xi$ . Then, as the ambiguity set degenerates, the problem (23) also degenerates to the robust optimization problem in Step 5 of Algorithm 4.
Now, we consider the construction of  $\Xi$ . We apply a kernel estimation in Steps 3 and 4 of Algorithm 4 to construct  $\Xi$ . The following proposition says that if we choose proper  $\varepsilon$  in Algorithm 4,  $\Xi$  contains the conditional mean  $\mathbb{E}[r|z_0]$ .
Proposition 6. Assume there exists a constant  $L$  such that the following condition holds for any  $z, z'$
Then under mild boundedness assumptions on the distribution, with probability no less than  $1 - \delta$ ,  $r_0$  defined in Algorithm 4 satisfies
$$
\| \mathbb {E} [ r | z _ {0} ] - r _ {0} \| _ {2} \leq O \left(\left(\frac {L d ^ {s / 2}}{\delta} + \frac {3 2}{\delta^ {1 / 2}}\right) \cdot T ^ {- \frac {s}{2 (s + d)}} \log T\right)
$$
when choosing the bandwidth  $h = T^{-\frac{1}{2s + 2d}}$ .
We defer the proof and assumptions to the next chapter. After developing this estimation error, if the feasible region of (1) is in the unit ball with probability 1, we can directly build the generalization bound for the downstream problem by Proposition 4:
Proposition 4. Under the same assumptions as in Proposition 6, Algorithm 4 outputs a solution  $\hat{x}(z_0)$  such that
$$
\mathbb {E} \left[ c ^ {\top} \left(\hat {x} \left(z _ {0}\right) - x ^ {*} \left(z _ {0}\right)\right) \right] \leq O \left(\left(\frac {L d ^ {s / 2}}{\delta} + \frac {3 2}{\delta^ {1 / 2}}\right) \cdot T ^ {- \frac {s}{2 (s + d)}} \log T\right).
$$
holds with probability no less than  $1 - \delta$ .
Here, we emphasize that if the residuals are i.i.d., we can equivalently have  $L = 0$ ,  $s = \infty$ . Then, the convergence rate of our Algorithm 4 is  $O(T^{-1/2})$ , which matches the rate in Wang et al. [2021], Kannan et al. [2020, 2021]. Moreover, we remark that our results have the potential to be generalized to general cases for distributionally robust optimization if there are more convergence theories developed for the non-i.i.d. samples. Specifically, if the distributions have some smooth properties with respect to the covariate  $z$ , the kernel estimation
$$
\mathcal {P} _ {r \mid z} ^ {\prime} = \sum_ {t \in \mathcal {D} _ {v a l}} w _ {t} \left(z _ {t}, z\right) \mathcal {P} _ {r \mid z _ {t}}, \tag {24}
$$
will also be a good approximation to  $\mathcal{P}_{r|z_0}$ , where  $w_{t}$  is the weight constructed in Step 3 in Algorithm 4 with some kernel function for all  $t\in \mathcal{D}_{val}$ . The proof will be similar to the proof of Proposition 6. Once being able to utilize samples in  $\mathcal{D}_{val}$  to approximate  $\mathcal{P}_{r|z}^{\prime}$ , we can develop a similar DRO algorithm for general cases. However, to our best knowledge, the current state-of-the-art theory can only approximate a distribution by the empirical distribution constructed by i.i.d. samples [Fournier and Guillin, 2015], and its proof cannot be extended to a more general non-i.i.d setting. Thus, one interesting future direction will be developing distributional convergence results for non-i.i.d. settings, and our framework can also have the potential to be applied in general distributionally robust problems.
In the following sections, we will provide detailed proof for Proposition 6 and 4. We first state and interpret our assumptions in Section C.2. Then, in Section C.3, we show two essential lemmas that are helpful for later proof. In Sections C.4 and C.5, we will rigorously restate and show those two propositions, respectively.
C.2 Assumptions for Algorithm 4
Now, we state those assumptions. Most of them are boundedness assumptions. We first state our assumptions about the residual. Recall the residual defined in Algorithm 4 is
$$
r = c - \hat {f} (z),
$$
for any obective vector  $c$  and covariate  $z$ , where  $\hat{f}$  is the prediction model.
Assumption 1. We assume the residual vector  $r$  satisfies the following conditions:
(a) Boundedness: the residual vector is bounded that  $r \in [-1, 1]^m$ .
(b) Distribution: the residual vector  $r$  given the covariate  $z$  follows some unknown continuous distribution  $\mathcal{P}_{r|z}$  with the density function  $p_{r|z}$ .
(c) Smoothness: for any two covariates  $z, z' \in [0,1]^d$ , the difference between the conditional means of  $\mathcal{P}_{r|z}$  and  $\mathcal{P}_{r|z'}$  satisfies
$$
\| \mathbb {E} [ r | z ] - \mathbb {E} [ r | z ^ {\prime} ] \| _ {2} \leq L \| z - z ^ {\prime} \| _ {2} ^ {s}
$$
for some positive constants  $L, s > 0$ .
Assumptions 1-(a),(b) are just boundedness conditions. Assumption 1-(c) says that the distribution of the residual vector  $r$  given the covariate  $z$  enjoys some smoothness, and  $s$  measures the order of the smoothness. Specifically, if we perturb the covariate  $z$  a little bit, the perturbation will only slightly change the corresponding conditional distribution of the residual  $r$  given  $z$ . This condition is weaker than many recent papers with some true-model assumptions. For example, Wang et al. [2021], Kannan et al. [2020] assume  $c = f_0(z) + \epsilon$  for some function  $f_0(z)$  and random noise  $\epsilon$ , and Kannan et al. [2021] also assume that all objective vectors for different covariates share a same type of randomness. When  $f_0(z)$  can be learned by the prediction model, Assumption 1-(c) holds for  $L = 0$  and  $s = \infty$ .
Assumption 2. We assume the covariate  $z$  satisfies the following conditions:
(a) Boundedness: the covariate is bounded that  $z \in [0,1]^d$ .
(b) Distribution: the covariate  $z$  follows some unknown continuous distribution  $\mathcal{P}_z$  with the density function  $p(z)\in C^1 ([0,1]^d)$ .
(c) Smoothness: the density function  $p(z) \in C^1([0,1]^d)$  satisfies  $p(z) \leq \bar{p}$  and  $\| \nabla p(z) \|_2 \leq c$  for some positive constants  $\bar{p}, c \geq 1$  and all  $z \in [0,1]^d$ .
The first two parts of Assumption 2 are also boundedness assumptions. Part (c) guarantees that the density function is smooth enough so that it has no steep peak and can not change drastically around any covariate  $z$ . We remark that we use this assumption only for simplicity, and it can be replaced by other weaker assumptions that can be satisfied by any density function. The last assumption is about the kernel function we used in Algorithm 4. It basically requires the kernel function to have bounded support and a positive lower bound on the support. This condition can also be satisfied by many kernel functions, such as the uniform kernel and the truncated Gaussian kernel.
Assumption 3. We assume the kernel function satisfies
$$
K (z) \geq b _ {r} \cdot 1 \{K (z) > 0 \} a n d K (z) \leq b _ {R} \cdot 1 \left\{\max  _ {i = 1, \dots , d} | z _ {i} | \leq R \right\},
$$
for some positive constants  $b_{R}, b_{r} > 0$  and  $R \geq 1$ .
C.3 Essential Lemmas of Proving Propositions 6 and 4
In this section, we let  $T = |\mathcal{D}_{val}|$  and the bandwidth  $h = T^{-\gamma}$ , where  $\gamma$  is a parameter that we will choose later. Without loss of generality, we let  $\mathcal{D}_{val} = \{1,\dots,T\}$ . For any vector  $z\in \mathbb{R}^d$ , we use  $(z)_i$  to denote its  $i$ -th entry for  $i = 1,\ldots ,d$ . In addition, denote  $z_{0}$  as the target covariate, denote  $K_{t} = K(\frac{z_{t} - z_{0}}{h})$  as the value of the kernel function evaluated at  $z_{t}$  with bandwidth  $h$ , and denote  $w_{t}(z_{t}) = \frac{K(\frac{z_{t} - z_{0}}{h})}{\sum_{i = 1}^{T}K(\frac{z_{i} - z_{0}}{h})}$  as the corresponding weight for any  $t\in \mathcal{D}_{val}$ . Moreover, for simplicity, by a little abuse of notation, we drop the input variables of the kernel and weight functions and use  $K_{t}$  and  $w_{t}$  to represent the value of the kernel function and the weight when the context is clear.
Before proving Propositions 6 and 4, we first provide two essential lemmas. Lemma 1 shows that, with high probability, there are at least  $O\left(T^{1 - d\gamma}\right)$  samples with positive weights. In the proof of the later lemma and Propositions 6 and 4, we will utilize those samples to give an approximation of the conditional mean of the target distribution  $\mathcal{P}_{r|z}$ .
Lemma 1. Under Assumption 2, for any positive constant  $\delta \in (0,1)$  and  $T\geq \max \left\{10,\left(\frac{\delta}{8c}\right)^{-\frac{1}{\gamma}}\right\}$ , with probability no less than  $1 - \frac{1}{T^2} -\frac{\delta}{2}$
$$
\sum_ {t = 1} ^ {T} 1 \left\{w _ {t} > 0 \right\} \geq \frac {\delta}{4} (2 R) ^ {d} T ^ {1 - d \gamma} - \sqrt {T} \log T. \tag {25}
$$
Specifically, if  $1 - d\gamma > \frac{1}{2}$  and  $T$  is sufficiently large such that  $\frac{\delta}{2}(2R)^d T^{1 - d\gamma} \geq 2\sqrt{T} \log T$ ,
$$
\sum_ {t = 1} ^ {T} 1 \left\{w _ {t} > 0 \right\} \geq \frac {\delta}{8} (2 R) ^ {d} T ^ {1 - d \gamma}. \tag {26}
$$
Proof. In the following, we show the first inequality (25). The second inequality (26) can be obtained by plugging the condition  $\frac{\delta}{8} (2R)^{d}T^{1 - d\gamma}\geq 2\sqrt{T}\log T$  into (25).
By Hoeffding's inequality, we have for any target covariate  $z_0$ , with probability no less than  $1 - \frac{1}{T^2}$
$$
\sum_ {t = 1} ^ {T} 1 \{w _ {t} > 0 \} \geq T \mathbb {E} \left[ 1 \left\{\max _ {i = 1, \dots , d} | (z) _ {i} - (z _ {0}) _ {i} | \leq R \cdot T ^ {- \gamma} \right\} \right] - \sqrt {T} \cdot \log T,
$$
where the probability is taken with respect to  $z_{t}$  for  $t = 1,\dots,T$ . Thus, it is sufficient to show that with probability no less than  $1 - \frac{\delta}{2}$
$$
\mathbb {E} \left[ 1 \left\{\max  _ {i = 1, \dots , d} | (z) _ {i} - (z _ {0}) _ {i} | \leq R \cdot T ^ {- \gamma} \right\} \right] \geq \frac {\delta}{4} (2 R) ^ {d} T ^ {- d \gamma},
$$
where the probability is taken with respect to  $z_0$ . To see this, for any  $z_0$  such that  $p(z_0) > \delta / 4$ , by Assumption 2-(c), we have that when  $T \geq \left(\frac{4\sqrt{d_c}}{\delta}\right)^{1 / \gamma}$ ,
$$
\begin{array}{l} p (z) \geq p (z _ {0}) - c \sqrt {d} R \cdot T ^ {- \gamma} \\ \geq \frac {\delta}{2} - \frac {\delta}{4} = \frac {\delta}{4} \\ \end{array}
$$
for all  $z$  satisfying  $\max_{i=1,\ldots,d} |(z)_i - (z_0)_i| \leq R \cdot T^{-\gamma}$ , where the first line comes from Taylor's expansion and Assumption 2-(c), and the second line comes the condition that  $T \geq \left(\frac{4\sqrt{dc}}{\delta}\right)^{1/\gamma}$ . Thus, by integrating the density function on the set  $\left\{z : \max_{i=1,\ldots,d} |(z)_i - (z_0)_i| \leq R \cdot T^{-\gamma}\right\}$ , we have
$$
\mathbb {E} \left[ 1 \left\{\max  _ {i = 1, \dots , d} | (z) _ {i} - (z _ {0}) _ {i} | \leq R \cdot T ^ {- \gamma} \right\} \right] \geq \frac {\delta}{4} (2 R) ^ {d} T ^ {- d \gamma}.
$$
Moreover, since  $\mathbb{P}(\{z:p(z) < \delta /2\}) = \int p(z)1\{(p(z) < \delta /2)\} \mathrm{d}z\leq \delta /2$  we have  $\mathbb{P}(\{z:p(z)\geq \delta /2\})\geq 1 - \delta /2$  , and we finish the proof.
The next lemma develops the concentration property for  $r_0$  defined in Step 3 in Algorithm 4.
Lemma 2. Under Assumptions 1 and 3, for any  $T > 0$ , with probability no less than  $1 - \frac{2n}{T^2}$ , the inequality below holds for all  $i = 1, \dots, n$
$$
\left| \sum_ {t = 1} ^ {T} w _ {t} (r _ {t}) _ {i} - \sum_ {t = 1} ^ {T} w _ {t} \mathbb {E} [ (r _ {t}) _ {i} | z _ {t} ] \right| \leq \frac {2 b _ {R}}{b _ {r}} \cdot \tilde {T} ^ {- \frac {1}{2}} \cdot \log T,
$$
where  $\tilde{T} = \sum_{t=1}^{T} 1\{w_t > 0\}$ . Here, the probability is taken with respect to the covariates  $z_1, \ldots, z_T$  and their corresponding residuals.
Proof. This is also an application of Hoeffding's inequality. We first show it for fixed  $z_{1}, \ldots, z_{T}$  and fixed target covariate  $z_{0}$ . In this case, we have  $\tilde{T} = \sum_{t=1}^{T} 1\{w_{t} > 0\}$  is fixed as well. Moreover, for any  $w_{t} > 0$ , by Assumption 3 and its definition in Algorithm 4 that it is a ratio between corresponding non-zero kernel functions, we have  $w_{t} \in \left[\frac{b_{r}}{b_{R}}, \frac{b_{R}}{b_{r}}\right]$ . In addition, by Assumption 1-(a) that each entry of the residual is in  $[-1,1]$ , we have  $w_{t} \cdot (r_{t})_{i}$  is bounded by  $\left[-\frac{b_{R}}{b_{r}}, \frac{b_{R}}{b_{r}}\right]$ . Thus, by Hoeffding's inequality (Lemma 3), we have with probability no less than  $1 - 2 / T^{2}$ ,
$$
\left| \sum_ {t = 1} ^ {T} w _ {t} \cdot (r _ {t}) _ {i} - \sum_ {t = 1} ^ {T} w _ {t} \mathbb {E} [ (r _ {t}) _ {i} | z _ {t} ] \right| \leq \frac {2 b _ {R}}{b _ {r}} \cdot \tilde {T} ^ {- \frac {1}{2}} \cdot \log T,
$$
for any  $i = 1,\dots,d$ . Then, we can find the result by taking the union bound for all entries  $i = 1,\dots,n$  and integrating the probability with respect to  $z_{1},\ldots,z_{T}$ .
Now, we are equipped with all essential lemmas, and in the following, we will show Propositions 6 and 4.
C.4 Proof of Proposition 6
In this section, we will adapt the same notation as in Section C.3.
Proposition 6. Under Assumptions 1, 2 and 3, with probability no less than  $1 - \delta$
$$
\left\| \mathbb {E} [ r | z _ {0} ] - r _ {0} \right\| _ {2} \leq \frac {b _ {R}}{b _ {r}} \cdot \left(\frac {1 6 L}{\delta} \cdot \bar {p} d ^ {s / 2} R ^ {s} + \frac {3 2 \sqrt {n}}{\delta^ {1 / 2}}\right) \cdot T ^ {- \frac {s}{2 s + 2 d}} \log T
$$
holds when choosing the bandwidth  $h = T^{-\frac{1}{2s + 2d}}$ .
Proof. To prove it, we first apply the triangle inequality that
$$
\begin{array}{l} \left\| \mathbb {E} [ r | z _ {0} ] - r _ {0} \right\| _ {2} \leq \left\| \mathbb {E} [ r | z _ {0} ] - \mathbb {E} [ r _ {0} | z _ {0}, \dots , z _ {T} ] \right\| _ {2} + \left\| r _ {0} - \mathbb {E} [ r _ {0} | z _ {0}, \dots , z _ {T} ] \right\| _ {2} \\ = \| \mathbb {E} [ r | z _ {0} ] - \sum_ {t = 1} ^ {T} w _ {t} \mathbb {E} [ r | z _ {t} ] \| _ {2} + \| r _ {0} - \mathbb {E} [ r _ {0} | z _ {0}, \dots , z _ {T} ] \| _ {2} \tag {27} \\ \leq L \cdot \sum_ {t = 1} ^ {T} w _ {t} \| \mathbb {E} [ r | z _ {0} ] - \mathbb {E} [ r | z _ {t} ] \| _ {2} + \| r _ {0} - \mathbb {E} [ r _ {0} | z _ {0}, \dots , z _ {T} ] \| _ {2} \\ \leq L \cdot \sum_ {t = 1} ^ {T} w _ {t} \| z _ {0} - z _ {t} \| _ {2} ^ {s} + \| r _ {0} - \mathbb {E} [ r _ {0} | z _ {0}, \dots , z _ {T} ] \| _ {2} \\ \end{array}
$$
where the first and the third line come from the triangle inequality, the second line comes from the definition of  $r_0 = \sum_{t=1}^{T} w_t r_t$ , and the last line comes from Assumption 1-(c). In the following, we analyze the first and the second terms in the last line, respectively.
We first analyze the first term in the last line of (27). Denote  $\tilde{T} = \sum_{t=1}^{T} 1\{w_t > 0\}$ . By Hoeffding's inequality, for fixed  $z_0$ , we have with probability no less than  $1 - \frac{2}{T^2}$ ,
$$
\begin{array}{l} \sum_ {t = 1} ^ {T} w _ {t} \| z _ {0} - z _ {t} \| _ {2} ^ {s} = \frac {1}{\sum_ {t = 1} ^ {T} K _ {t}} \sum_ {t = 1} ^ {T} K _ {t} \| z _ {0} - z _ {t} \| _ {2} ^ {s} \\ \leq \frac {1}{b _ {r} \tilde {T}} \sum_ {t = 1} ^ {T} K _ {t} \| z _ {0} - z _ {t} \| _ {2} ^ {s} \tag {28} \\ \leq \frac {1}{b _ {r} \tilde {T}} \left(T \mathbb {E} [ K _ {1} \| z _ {1} - z _ {0} \| _ {2} ^ {s} ] + b _ {R} d ^ {s / 2} R ^ {s} T ^ {1 / 2 - s \gamma} \log T\right), \\ \end{array}
$$
where the first line comes from the definition of  $w_{t}$ , the second line comes from Assumption 3, which gives the lower bound of the kernel function, and the third line comes from Hoeffding's inequality. Then, we compute the expectation
$$
\begin{array}{l} \mathbb {E} \left[ K _ {1} \| z _ {1} - z _ {0} \| _ {2} ^ {s} \right] \leq \mathbb {P} \left(K _ {1} > 0\right) \cdot b _ {R} d ^ {s / 2} R ^ {s} T ^ {- s \gamma} \\ \leq \bar {p} \cdot (2 R T ^ {- \gamma}) ^ {d} \cdot b _ {R} d ^ {s / 2} R ^ {s} T ^ {- s \gamma} \\ = \bar {p} b _ {R} 2 ^ {d} R ^ {d + s} T ^ {- s \gamma - d \gamma}. \\ \end{array}
$$
Here, the first step is obtained by Assumption 3, the upper bound of the kernel function and the boundedness of its support, the second line comes from Assumption 2, the upper bound of the density function, and the last line is obtained by calculation. Plugging this upper bound into (28), we have the first term in the right-hand side of (27) can be bounded by
$$
L \sum_ {t = 1} ^ {T} w _ {t} \| z _ {0} - z _ {t} \| _ {2} ^ {s} \leq \frac {L b _ {R}}{b _ {r} \tilde {T}} \left(2 ^ {d} \bar {p} R ^ {d + s} T ^ {1 - s \gamma - d \gamma} + d ^ {s / 2} R ^ {s} T ^ {1 / 2 - s \gamma} \log T\right). \tag {29}
$$
Then, for the second term in the right-hand side of (27), under the event of Lemma 2, we have for fixed  $z_0$
$$
\left\| r _ {0} - \mathbb {E} \left[ r _ {0} \mid z _ {0}, \dots , z _ {T} \right] \right\| _ {2} \leq \frac {2 b _ {R} \sqrt {n}}{b _ {r}} \cdot \tilde {T} ^ {- \frac {1}{2}} \cdot \log T. \tag {30}
$$
Next, we combine (29) and (30) to draw the result. Under the event of Lemma 1 that
$$
\tilde {T} \geq \frac {\delta}{8} (2 R) ^ {d} T ^ {1 - d \gamma},
$$
the inequality (29) becomes
$$
L \sum_ {t = 1} ^ {T} w _ {t} \| z _ {0} - z _ {t} \| _ {2} ^ {s} \leq \frac {8 L b _ {R}}{\delta b _ {r}} \left(\bar {p} R ^ {s} + d ^ {s / 2} 2 ^ {- d} R ^ {s - d}\right) \cdot T ^ {- \min  \{s \gamma , 1 / 2 + s \gamma - d \gamma \}} \log T, \tag {31}
$$
and the inequality (30) becomes
$$
\left\| r _ {0} - \mathbb {E} \left[ r _ {0} \mid z _ {0}, \dots , z _ {T} \right] \right\| _ {2} \leq \frac {b _ {R} \sqrt {n}}{b _ {r} 2 ^ {(d - 5) / 2} R ^ {d / 2} \delta^ {1 / 2}} \cdot T ^ {- \frac {1 - d \gamma}{2}} \cdot \log T. \tag {32}
$$
The event of the intersection of events corresponding to Lemma 1 and inequalities (29) and (30) happens with probability no less than  $1 - \frac{\delta}{2} - \frac{2n + 3}{T^2}$ . Thus, if  $T \geq \sqrt{\frac{4n + 6}{\delta}}$ , plugging (31) and (32) into (27), we have with probability no less than  $1 - \delta$ ,
$$
\| \mathbb {E} [ r | z _ {0} ] - r _ {0} \| _ {2} \leq \frac {b _ {R}}{b _ {r}} \cdot \left(\frac {1 6 L}{\delta} \cdot \bar {p} d ^ {s / 2} R ^ {s} + \frac {3 2 \sqrt {n}}{\delta^ {1 / 2}}\right) \cdot T ^ {- \min  \{s \gamma , 1 / 2 + s \gamma - d \gamma , 1 / 2 - d \gamma / 2 \}} \log T.
$$
Finally, let  $\gamma = \frac{1}{2s + 2d}$ , we finish the proof.
C.5 Proof of Proposition 4
In this section, we also use the same notation as in Sections C.2 and C.4. We show that the optimality gap between the solution given by Algorithm 4 and the optimal solution converges to 0 as  $T \to \infty$ .
Proposition 4. Suppose the feasible region  $\{x:Ax\leq b,x\geq 0\}$  is included in the unit ball  $\{x:\| x\| \leq 1\}$ . and the absolute values of each entry of the prediction function is bounded by  $\bar{f}$ . Under Assumptions 1, 2 and 3, Algorithm 4 outputs a solution  $\hat{x} (z_0)$  such that with probability no less than  $1 - \delta$
$$
\mathbb {E} \left[ c ^ {\top} \left(\hat {x} \left(z _ {0}\right) - x ^ {*} \left(z _ {0}\right)\right) \mid z _ {0} \right] \leq \frac {b _ {R}}{b _ {r}} \left(\frac {3 2 L}{\delta} \cdot \bar {p} d ^ {s / 2} R ^ {s} + \frac {6 4}{\delta^ {1 / 2}}\right) \cdot T ^ {- \frac {s}{2 s + 2 d}} \log T,
$$
where  $x^{*}(z_{0})$  is the optimal solution to  $LP(\mathbb{E}[c|z_0], A, b)$ , and the probability is taken with respect to  $z_{1}, \ldots, z_{T}$ , their corresponding objective vectors, the constraints  $(A, b)$  and the target covariate  $z_{0}$ .