How to detect inflection points without function expression in a live time series scenario?

1.2k Views Asked by At

enter image description hereMost of the learnings and examples out there talks about finding inflection point given there is a function expression. What happens when I do-not know the function expression? The movement of the graph is not defined by any formula and the graph is live in nature .
How to calculate the inflection points, positive, negative slopes from the graph itself in a continuous manner in time ?

1

There are 1 best solutions below

2
On BEST ANSWER

OK, VERY IMPORTANT: what you've circled are most definitely NOT inflection points. You have circled local minima. There are many algorithms for finding those that are very efficient. One of the easiest things you could do, I think, is simply multiply all the $y$ values by $-1$ and then use a peak-finding routine. Peak-finders are very common and not difficult to find. The trick with peak-finders is to choose the window size. If you choose it too large, your algorithms gets "ham-fisted" and won't detect peaks in a smaller region very well. On the other hand, your data oscillates enough to where setting the window size too small will find far too many peaks. Another thing you could try is first filtering your data before running it through the peak-finder. I find a median filter works well if you have a lot of outliers. Your example data doesn't look like it has too many outliers, so maybe just a regular low-pass filter would do the trick. So that's my recommendation: use a low-pass filter (plot the filtered on top of the unfiltered to make sure your cutoff frequency is set reasonably) then use the peak-finder on $-y.$