I have some data shown in the image. Each symbol corresponds to a different dataset. As it can be seen the data initially behaves like a line and after some points it follows other behaviour.
[![enter image description here](https://i.stack.imgur.com/LKg8F.png)](https://i.stack.imgur.com/LKg8F.png)

The idea is to fit a line that passes through the origin and that the line "is good enough" approximating the behaviour of the data where it is linear.

What I tried is to do the following: I pick a minimum of data (e.g. $m\_i$) for each data set $D\_i = \{d\_{ij}=(x\_j,y\_j)\_i, j\in\{1,...,N\_i\}\}$, where $N\_i = |D\_i|$ is the number of data of each set, and $x\_1=0, x\_p < x\_q$ if $p < q$ . Now, for $D\_i$ we consider subsets $S\_{ik}=\{d\_{ij}=(x\_j,y\_j)\_i, j\in\{1,...,k\_i\}\}$, where $k\_i \in \{m\_i,...,N\_i\}$. Each of these subsets has associated with it a correlation coefficient $p\_{ik}$. My idea was to pick the maximum of these coefficients and to fit a line $y=mx$ through the data in $S\_{ik}$ associated with $\max\_k p\_{ik}$.

The problem with this is that the correlation coefficient tells how the $y$ data behaves with respect to the $x$ data, i.e. how good a line would fit the data. This line intercepts the $y$ axis at a point that in general is not $0$.

My next try was to instead fit a line $y=mx$ for each $S\_{ik}$ and then compute the mean squared error MSE. Then pick the subset that is associated with the minimum value of MSE. This also fails because of course the minimum value is the one associated with the subset with less number of data (MSE penalizes the variation very hard, I look for something "softer").

Is there a way of knowing where the data behaves like a line passing through the origin? I was thinking of taking a small subset of data S\_{ik}, fitting a line $y\_i=mx$, computing the MSQ. Then adding one data point to the subset and computing its error, then compare it with the MSQ and decide whether to continue the process of adding data, or stopping.

Any help is very much appreciated.