Find the 'shape' of a list of numbers (straight-line/concave/convex, how many humps)
How about if you difference the data (I.e., x[i+1] - x[i]) repeatedly until all the results are the same sign? For example, if you difference it twice and all the results are nonnegative, you know it's convex. Otherwise difference again and check the signs. You could set a limit, say 10 or so, beyond which you figure the sequence is too complex to characterize. Otherwise, your shape is characterized by the number of times you difference, and the ultimate sign.
This is a bit hard to explain. I have a list of integers. So, for example, [1, 2, 4, 5, 8, 7, 6, 4, 1] - which, when plotted against element number, would resemble a convex graph. How do I somehow extract this 'shape' characteristic from the list? It doesn't have to particularly accurate - just the general shape, convex w/ one hump, concave w/ two, straight line, etc - would be fine.
I could use conditionals for every possible shape: for example, if the slope is positive upto a certain index, and negative after, it's a slope, with the skewness depending on index/list_size.
Is there some cleverer, generalised way? I suppose this could be a classification problem - but is it possible without ML?
Cheers.