# Low-Cost Active Anomaly Detection with Switching Latency
## 4 Numerical Results
### Scenario 1: \(s=o(B)\)  
In this part, we compare the performances of DMSC policy, R-SPRT and CL-\(\tau cN\) policy for \(M=5\) and \(L=2\) in Scenario 1 where \(s=o(B)\) as \(\alpha\to 0\).  
First, we consider the case where \(s\) is fixed, which means that the ratio of the single-switching delay to the single-observation delay is fixed. We set that \(s=2\). Since \(B\approx\log\frac{1-\alpha}{\alpha}\), in this case, \(s/B=0\) as \(\alpha\to 0\), i.e., \(s=o(B)\) holds. Note that since \(s\) is fixed, the value of the offset \(\triangle(M,L)\) changes as the threshold \(B\) increases, which leads to the switch between Case I and Case II in DMSC policy. We set \(\lambda_{f}=2\), \(\lambda_{g}=0.01\) and \(c=1\). We average the results over \(5\cdot 10^{4}\) trials. Figure 1(a) illustrates the change in the choice of the decision-maker of probing the process \(m^{\text{I}}(n)\) or process \(m^{\text{I}}(n)\) as \(B\) increases for fixed \(s\). The decision-maker chooses the strategy by comparing \(\frac{2D(g||f)}{L+1}+\triangle(M,L)\) and \(\frac{D(f||g)}{M-L}\) as shown in (8). The greater \(B\) is, the smaller \(\triangle(M,L)\) is and the problem is more likely to be in Case II. Thus, there is a switch from Case I to Case II, which is visualized in the simulation figure as the line of DMSC policy (solid black line) overlaps with the line of DMSC policy's Case I (dashed blue line) before the point \(B=40\) and overlaps with the line of DMSC policy's Case II (dashed red line) after that point. As a result of the switching from Case I to Case II, the DMSC policy can achieve the objective of minimizing the expected cumulative cost. Furthermore, Figure 2b shows the relative cost under the DMSC policy and other policies as compared to the asymptotic lower bound. It can be seen that the DMSC policy significantly outperforms the others in the finite regime for all values of \(B\) and the relative cost of DMSC policy will approach 0 as \(\alpha\to 0\), which is consistent with the conclusion of Theorem 1 that the DMSC policy is asymptotically optimal as \(\alpha\to 0\). Besides, it can be noticed that the performance of the R-SPRT policy is worse than that of the DMSC policy but better than of CL-\(\tau cN\) policy.  
Then, we consider the case where \(s/B=2\alpha\), which means \(\lim_{\alpha\to 0}s/B=0\) and \(\triangle(M,L)\) approaches 0 as \(\alpha\to 0\). We set \(\lambda_{f}=1\) and \(\lambda_{g}=3\), thus \(\frac{2D(s||f)}{L+1}\approx 0.96\) and \(\frac{D(f||g)}{M-L}\approx 0.30\). Therefore, in this case, \(\frac{2D(s||f)}{L+1}>\frac{D(f||g)}{M-L}\) holds for each \(B\) in the simulation  
Figure 2: Performance comparison for \(M=5\), \(L=2\), \(s=2\), \(\lambda_{f}=2\), \(\lambda_{g}=0.01\). (**a**) Average cost under DMSC policy. (**b**) Relative cost under the DMSC policy, the Sequential Probability Ratio Testing policy (R-SPRT) and CL-\(\tau cN\) policy as compared to the asymptotic lower bound. \(L_{\text{DMSC}}\) approaches 0 as \(B\rightarrow\infty\) (\(\alpha\to 0\) ).  
and the DMSC policy selects process \(m^{1}(n)\) at each given time \(n\). We average the results over \(5\cdot 10^{4}\) trials. The relative costs under the DMSC policy and other policies as compared to the asymptotic lower bound are presented as a function of the threshold \(B\) in Figure 3. It is obvious that the performance of the DMSC policy is superior to that of others.