I have many discrete functions that follow the same trend. An example of discrete function is shown in the figure below.
At each step, represented on x-axis, we reduce a given area, represented on y-axis. As you can see, the first part of the function decreases very quickly, and after a point P the function follows a linear and steady trend till the end. I want to define an algorithm to find the point P, either without parameters or with an absolute threshold (e.g., a percentage).
Do you have any suggestions? Thanks.
Assuming you have $N$ values making up your functions, denote each point by $f_i$ for $i = 1,..,N$ and going from left to right.
Then let another index be $j$. For $j$ starting at 1 initially do a linear fit on the reduced data set $\{f_j,..,f_N\}$ and let the y intercept for that value of $j$ be $C_j$. From the data it is clear that as $j$ increases $C_j$ will decrease, but this decrease will become increasingly smaller as we approach the point P. Therefore you can write a program which will keep increasing $j$ until $$|C_j - C_{j-1}| < \tau$$
where $\tau$ is some tolerance value which you'll need to choose (you can probably work out a good value by just playing with different values until you seem to be getting good results).
This might not work perfectly with the 'kink' in the data as graphed above, but it will certainly give you a good estimate and you could improve the estimate by say only stopping once the current change in y-intercept is small enough, but that also the next 10 (for example) intercepts for increasing j also have intercept changes below $\tau$, or maybe just stipulate that once the above criterion (in the formula) is met we also need the next 10 steps to have intercept changes smaller than the current one.
This is just one of a whole load of possible approaches.