# Anomaly Detection in High-Dimensional Time Series Data with Scaled Bregman Divergence
## 2 Materials and Methods
### Algorithm and Computational Complexity Analysis
#### 2.3.1 Anomaly Detection Algorithm
This is because \(L_{2}\) loss involves matrix inversion, which is computationally expensive, whereas \(L_{1}\) loss avoids matrix inversion, relying only on element-wise operations and vector additions. Consequently, \(L_{1}\) loss offers a more computationally efficient alternative while maintaining comparable performance in this case. In previous studies, metrics such as accuracy, precision, recall, and F1 score have been widely used to evaluate anomaly detection methods. These metrics are calculated based on true positive (TP), false positive (FP), false negative (FN), and true negative (TN) values. However, their dependency on a chosen threshold can lead to varying conclusions, making \begin{table}
\begin{tabular}{l l l l l l l} \hline \hline
**Method** & **Loss** & \(\alpha\) & **Thyroid** & **Time (s)** & **Breast Cancer** & **Time (s)** \\ \hline \multirow{2}{*}{uLSIF} & L1 & 0 & 0.4949 & 14.57 & 0.4180 & 19.99 \\  & L2 & 0 & 0.4769 & 18.71 & 0.5065 & 37.65 \\ \hline \multirow{6}{*}{RuLSIF} & L1 & 0.01 & 0.4985 & 13.50 & 0.4260 & 18.99 \\  & L1 & 0.10 & 0.5318 & 13.53 & 0.5002 & 17.89 \\  & L1 & 0.50 & 0.5231 & 13.59 & 0.4446 & 18.66 \\  & L1 & 0.90 & 0.5108 & 14.75 & 0.4207 & 18.86 \\ \cline{2-6}  & L2 & 0.01 & 0.4769 & 18.24 & 0.5065 & 27.42 \\  & L2 & 0.10 & 0.5495 & 18.30 & 0.5002 & 23.87 \\  & L2 & 0.50 & 0.5241 & 18.37 & 0.4619 & 25.69 \\  & L2 & 0.90 & 0.5123 & 18.56 & 0.4270 & 23.37 \\ \hline \multirow{6}{*}{PLsBD} & L1 & 0.01 & 0.4615 & 12.70 & 0.4812 & 16.25 \\  & L1 & 0.10 & 0.4846 & 13.13 & 0.5002 & 16.93 \\ \cline{1-1}  & L1 & 0.50 & 0.5277 & 13.14 & 0.4506 & 16.03 \\ \cline{1-1}  & L1 & 0.90 & 0.5103 & 13.15 & 0.4204 & 16.07 \\ \cline{1-1} \cline{2-6}  & L2 & 0.01 & 0.4769 & 17.47 & 0.5065 & 21.64 \\ \cline{1-1}  & L2 & 0.10 & 0.5338 & 17.88 & 0.5002 & 22.79 \\ \cline{1-1}  & L2 & 0.50 & 0.5223 & 17.77 & 0.4439 & 21.87 \\ \cline{1-1}  & L2 & 0.90 & 0.5108 & 17.40 & 0.4207 & 24.81 \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Mean AUC values of 20 for thyroid and breast cancer datasets with different \(\alpha\) values and loss functions, including computation time. them less reliable for consistent model comparison. To provide a more comprehensive evaluation, we also computed accuracy, precision, F1 score, and computation time for different loss functions and varying values of \(\alpha\). The results, summarized in Table 4, further validate that RuLSIF and PLsBD methods favor smaller \(\alpha\) values, with computation time primarily influenced by the chosen loss function. ## 4 Discussion

In this work, we proposed and applied a novel scaled Bregman divergence-based anomaly detection algorithm to identify abnormal observations in both low- and high-dimensional data. Compared to existing density ratio estimation-based anomaly detection algorithms, such as KLIEP and uLSIF, our method addresses the unboundedness issue. Additionally, we derived an analytical formula to learn the density ratio using both the least absolute error and least squared error as loss functions. We applied the scaled Bregman divergence-based method, PLsBD, along with RuLSIF and uLSIF, to identify anomalies in both simulation data and real-world high-dimensional data, comparing their performance. Our results demonstrate that both PLsBD and RuLSIF outperform uLSIF, which was previously considered the state-of-the-art density ratio-based anomaly detection method. We also found that the mixing parameter \(\alpha\), window size, and step size significantly influence the algorithm's performance, with smaller \(\alpha\) values (e.g., \(\alpha\) = 0.1) and smaller step sizes yielding better results. Moreover, when the data contain fewer anomalies, the \(L_{2}\) loss function outperforms the \(L_{1}\) loss. However, as the number of anomalies increases, the performance difference between the two loss functions becomes minimal.