# Anomaly Detection in Financial Time Series by Principal Component Analysis and Neural Networks +
## 5 Model Evaluation: Main Results
### Anomaly Localization Step  
Regarding the localization step, the dummy approach consisted of taking the argmax of the time series observations as the anomaly location. We distinguished between two cases, anomalies that were extrema and anomalies that were not. The quality of the  
\begin{table}
\begin{tabular}{l c c c c} \hline \hline
**Data Set** & **Accuracy** & **Precision** & **Recall** & **F\({}_{1}\)-Score** \\ \hline Train set & 79.02\% (2.4\%) & 78.69\% (2.7\%) & 79.74\% (4.6\%) & 79.13\% (2.7\%) \\ Test set & 77.79\% (3.9\%) & 41.87\% (5.2\%) & 80.16\% (6.4\%) & 54.82\% (5.2\%) \\ \hline \hline \end{tabular}
\end{table}
Table 4: Mean (standard deviation) of performance metrics of the suggested model over multiple runs for the identification step.  
Figure 6: Two examples of uncontaminated time series accurately identified by the model. The stock path and the reconstruction errors are represented in black and brown.  
Figure 7: Two examples of time series misidentified by the model. The stock path and the reconstruction errors are represented in black and brown. The red cross shows the anomaly localization.  
detection of our model was assessed for both types of anomalies. The results are displayed in Tables 5 and 6.  
The numerical tests showed the necessity of the feature extraction step for the anomaly localization task, as applying the dummy approach alone was not enough when the anomaly was not an extreme value. Figure 8 represents a stock price time series with the true and predicted anomaly locations. In these examples, the locations were accurately predicted.  
To guarantee the robustness of the model on the anomaly location, we evaluated the model prediction on 100 data sets. Table 7 shows the mean and standard deviations for the localization step of all types of anomalies.  
Table 8 displays the results of the localization of the non-extrema anomalies. These results show the importance of the feature extraction step. If we only considered the  
\begin{table}
\begin{tabular}{l l l l l} \hline \hline
**Data Set** & **Accuracy** & **Precision** & **Recall** & **F\({}_{\mathbf{1}}\)-Score** \\ \hline Train set & 84.22\% (0\%) & 84.55\% (0\%) & 84.28\% (0\%) & 89.68\% (0\%) \\ Test set & 91.92\% (0\%) & 92.10\% (0\%) & 91.92\% (0\%) & 91.90\% (0\%) \\ \hline \hline \end{tabular}
\end{table}
Table 6: Performance evaluation of the suggested model and the dummy approach on synthetic data set for the localization step of non-extrema anomalies.  
\begin{table}
\begin{tabular}{l l l l l} \hline \hline
**Data Set** & **Accuracy** & **Precision** & **Recall** & **F\({}_{\mathbf{1}}\)-Score** \\ \hline Train set & 89.58\% (4.3\%) & 89.58\% (4.3\%) & 89.96\% (4.1\%) & 89.67\% (4.3\%) \\ Test set & 89.49\% (4.8\%) & 89.49\% (4.8\%) & 90.00\% (4.5\%) & 89.58\% (4.7\%) \\ \hline \hline \end{tabular}
\end{table}
Table 7: Mean (standard deviation) of performance metrics of suggested model over multiple runs for localization step of all types of anomalies.  
Figure 8: Anomaly localization prediction for two distinct time series.  
\begin{table}
\begin{tabular}{l l l l l} \hline \hline
**Data Set** & **Accuracy** & **Precision** & **Recall** & **F\({}_{\mathbf{1}}\)-Score** \\ \hline Train set & 89.65\% (34.87\%) & 89.81\% (40.53\%) & 89.65\% (34.88\%) & 89.68\% (36.56\%) \\ Test set & 94.39\% (27.78\%) & 94.49\% (31.52\%) & 94.39\% (27.78\%) & 94.38\% (28.94\%) \\ \hline \hline \end{tabular}
\end{table}
Table 5: Performance evaluation of the suggested model and (the dummy approach) on synthetic data set for the localization step of all types of anomalies.  
maximal observed value of the time series to be the anomaly, we would not have been able to localize any non-extrema anomalies. Applying Algorithm 4 instead led to satisfactory anomaly detection rates.