I am working on a problem that needs best fit line, though the best fit should be applied on initial part of the data and not the whole datapoints.
I know how to curve-fit a function on a dataset when I want to apply it to the whole dataset but don't know how to implement this in my problem.
What I want to do is:
- find the point after which the dataset deviates from a straight line which can change in each dataset (my main problem)
- find the best fit (straight line) on the datapoints (the blue line in the sketch below).
Please let me know your thoughts.