Question: I have a set of force profiles of an industrial machine. I'm trying to develop an algorithm that tries to understand when a new profile is "anomalous" with respect to the ones in "normal operating conditions".

In the picture below you can see the force profiles (function of time). I want the blue curve found checked as anomalous.

What approaches do you suggest? I'm thinking about using some statistical distance (like mahalanobis) to check the similarity of a new curve to the "mean" of the others.

Another point: it can be useful to use approaches like PCA in this case? Then I can try to use clustering techniques to separate anomalous profile from normal ones. I'm not sure since I have a great number of observations but of the same variable and PCA is a multivariate technique.

![force profiles - blue is anomalous](https://i.stack.imgur.com/t3Udo.png)][1](https://i.stack.imgur.com/t3Udo.png)

Answer: 
I strongly recommend to start with a simple statistical data analysis. In this approach you take the [Moving Average/Median](https://en.wikipedia.org/wiki/Moving_average) of signals and if one signal shows a magnitude -/+ 3 times standard deviation, you mark it as anomaly. [Please have a look at this answer for Python code](https://datascience.stackexchange.com/a/6549/8878).
Trust me and use the **Isolation Forest** from [scikit-learn](https://scikit-learn.org/stable/modules/generated/sklearn.ensemble.IsolationForest.html), and if you want to have more options with Isolation Forese use the library [PYOD](https://pyod.readthedocs.io/en/latest/_modules/pyod/models/iforest.html).