## 3 The Minimum Relative Regret of the wSAA Framework
### The Analysis of the PDP  
In this section, we will analyze the PDP. Consider the demand function \(D\), where \(D:\mathbb{R}^{+}\rightarrow\mathbb{R}^{+}\), \(D(x)=10x\). In this context, \(x\) represents a feature related to the demand, and \(D(x)\) corresponds to the actual demand in terms of quantity. Historical data is given as two points in this demand space, \((x_{1}=1,y_{1}=10)\) and \((x_{2}=2,y_{2}=20)\), where \(y_{1}\) and \(y_{2}\) denote the historical realizations of demand. We consider a unit production cost of 1, a selling price per unit of 2, and the to-be-determined production quantity as \(z\). Now, we encounter a new \(x_{0}\), which equals a very large positive value \(M\) and thus lies outside the range of known data samples. Assuming we only have access to the two historical data points and do not know the underlying relationship (distribution) of demand given the feature, we must make the production decision. Therefore, we formulate the CSO problem with the aim of maximizing the profit (price minus cost) as follows:  
\[\max_{z}\mathbb{E}\big{[}c(\hat{y},z)|x=x_{0}\big{]}=\max_{z\geq 0}\mathbb{E} \big{[}2\min\{\hat{y},z\}-z|x=x_{0}\big{]}, \tag{7}\]  
where \(\hat{y}\) denotes the uncertain demand given \(x_{0}\).  
To solve this problem, we apply the wSAA framework, which assigns varying weights to samples 1 and 2. These weights are determined based on the similarity between the contextual data of the new observation and the contextual data of each historical sample. Additionally, the weights are normalized to ensure that they sum to one. We denote the weight of sample 1 as \(\pi\) and the weight of sample 2 as \(1-\pi\). Therefore, we need to solve the following wSAA of (7):  
\[\max_{z\geq 0}\pi\big{[}\underbrace{2\min\{y_{1},z\}-z}_{\text{decision problem of $y_{1}$}}\big{]}+(1-\pi)\big{[}\underbrace{2\min\{y_{2},z\}-z}_{\text{decision problem of $y_{2}$}}\big{]}, \tag{8}\]  
where the data-driven optimal decision is \(\hat{z}_{2,\text{PDP}}^{\text{wSAA}}(x_{0})=\pi y_{1}+(1-\pi)y_{2}=20-10\pi\). Because \(\pi\) can span any any value on \([0,1]\) due to the use of different weighting schemes, the problem has an infinite number of data-driven optimal solutions. Given the underlying relationship \(\tilde{y}=D(x)=10x\), an upper bound of the expected profits for all these data-driven optimal solutions can be obtained as follows:  
\[\max_{z_{2,\text{PDP}}^{\text{wSAA}}(x_{0})=20-10\pi}\mathbb{E}_ {\tilde{y}=10x}\Big{[}c\big{(}\tilde{y};\hat{z}_{2,\text{PDP}}^{\text{wSAA}}( x_{0})\big{)}|x=x_{0}\Big{]} \tag{9}\] \[= \max_{\pi\in[0,1]}\mathbb{E}_{\tilde{y}=10x}\Big{[}2\min\{\tilde {y},20-10\pi\}-(20-10\pi)|x=x_{0}\Big{]}\] \[= 20,\]  
where \(\pi^{*}=0\), \(\hat{z}_{2,\text{PDP}}^{\text{wSAA},*}(x_{0})=20\), and no weighting scheme can achieve an expected profit higher than 20. This result signifies that the optimal weighting scheme that can achieve the highest expected profit is to assign sample 1 a weight of 0 and sample 2 a weight of 1.  
However, if we knew the underlying relationship \(\tilde{y}=10x\) and given the CSO problem (7), we should solve  
\[\max_{z\geq 0}\mathbb{E}_{\tilde{y}=10x}\big{[}2\min\{\tilde{y},z\}-z|x=x_{0} \big{]}, \tag{10}\]  
where the oracle with knowledge of the demand function should be \(z^{*}(x_{0})=M\), and the corresponding expected profit would be \(M\). Therefore, the minimum relative regret of the PDP would be  
\[\mathcal{R}_{2,\text{PDP}}^{\text{wSAA}}(x_{0}):=\frac{M-20}{M}\longrightarrow 1,\text{ when }M\longrightarrow\infty. \tag{11}\]  
This analysis clearly shows that as \(M\) increases significantly, the minimum relative regret \(\mathcal{R}_{2-\text{PDP}}^{\text{wSAA}}(x_{0})\) tends towards one, highlighting the inherent limitations of using the wSAA framework when data samples are limited. We further use another problem to show that the minimum relative regret of the wSAA framework tends towards one even when the new observation lies within the range of known data samples.