<p>I think similar problems arise naturally in the stock market and in general when detecting outliers.</p>
<p>So there are different way to move. Probably 1 is good enough.</p>
<ol>
<li><p>It looks like you have a <a href="https://en.wikipedia.org/wiki/Moving_average" rel="nofollow noreferrer">moving average</a> in the graphs. You could just take the difference to the moving average and see the distribution to evaluate the the appropriate thresholds for you to pay attention. It looks like in the first graph you have an event perhaps relevant. You could just place a threshold like two standard deviations of the average of the difference between the real series and the moving average.</p>
</li>
<li><p>De-trend each series. Even 1) could be good enough (I mean just substraction of real value for the series minus the average for the last X days), you could de-trend using more sophisticated ideas. But that could need more attention for each case, for instance you should be careful with seasonality and so on. Perhaps something line <a href="https://en.wikipedia.org/wiki/Hodrick%E2%80%93Prescott_filter" rel="nofollow noreferrer">Hodrick Prescott</a> or inline with this: <a href="https://machinelearningmastery.com/decompose-time-series-data-trend-seasonality/" rel="nofollow noreferrer">https://machinelearningmastery.com/decompose-time-series-data-trend-seasonality/</a>.</p>
</li>
<li><p>Perhaps the idea from 1) is more formally described as <a href="https://en.wikipedia.org/wiki/Bollinger_Bands" rel="nofollow noreferrer">Bollinger Bands</a>. That help you to know where the time series should be with some probability.</p>
</li>
<li><p>There are more sophisticated ways to identify outliers in time series (as in here: <a href="https://towardsdatascience.com/effective-approaches-for-time-series-anomaly-detection-9485b40077f1" rel="nofollow noreferrer">https://towardsdatascience.com/effective-approaches-for-time-series-anomaly-detection-9485b40077f1</a>) or here for a literature review: <a href="https://arxiv.org/pdf/2002.04236.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/2002.04236.pdf</a></p>
</li>
</ol>
How to sort many time series' by how trending each series is
<p>Hi I am recording data for around 150k items in influx. I have tried grouping by item id and using some of the functions from <a href="https://docs.influxdata.com/influxdb/v1.8/query_language/functions/" rel="nofollow noreferrer">the docs</a> but they don't seem to show &quot;trend&quot;.</p>
<p>As there are a lot of series' to group by. I am currently performing a query on each series to calculate a value, storing it and sorting by that.</p>
<p>I have tried to use Linear Regression (the average angle of the line) but it's not quite meant for this as the X axis are timestamps, which do not correlate to the Y axis values, so end up with a near vertical line. Maybe i can calculate the X values to be something else?</p>
<p>The other issue i have is some series' are much higher values than others, so one series jumping up by 1000 might be huge (very trending) and not a big deal for other series that are always much higher.</p>
<p>Is there a way i can generate a single value from a series that represents how trending the series is, eg its just jumped up quite a lot compared to normal.</p>
<p>Here is an example of one series that is not trending and one that was trending a couple days ago. So the latter would have a higher trend value than the first:</p>
<p><a href="https://i.imgur.com/lDIIULv.png" rel="nofollow noreferrer"><img src="https://i.imgur.com/lDIIULv.png" alt="enter image description here" /></a></p>
<p><a href="https://i.stack.imgur.com/EA1gF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EA1gF.png" alt="enter image description here" /></a></p>
<p>Thanks!</p>