Separate clusters from a single column of data Is there any statistical method to separate the visual groups of data from the graph shown below? As you can see from the figure, there are 4 clusters of data which I wan to separate them out.
I tried using hdbscan but it doesn't work well for this. or maybe I am not using it the right way.
I also tried taking the derivative of consecutive points by diff(y)/diff(x), but the problem are the data points marked in the blue circle. Some of them are outliers, some of them are just a part of the data, so the largest drop may not occur if there are a number of such data points in between 2 groups, and hence we may miss catching the x value at which the drop occurs
Any help is appreciated, thanks!


*I also want to find the x values at which the drop occurs as indicated by red dots on the x axis, which seems to be the visual value. I would like to find it using some technique so that I don't have to manually pick up when the data is very large



 A: One way to define those clusters is in terms of neighboring points. Pick a fixed radius $r$ and, for each data point, consider all other points within range $r$. You can then throw out the path-components with too few data points. This induces a graph where each path-component is one cluster (given you chose the right radius $r$).
To get the $x$-value, consider the rightmost point of each path component.
A: Based on your above answer, I'll give a suggestion for the case where you are trying to predict Y on X where Y and X correspond to the plotted axis. You can view the task as clustering but I think that leads you in the wrong direction. Instead, consider the problem of identifying points of change in the data (discontinuities, changes in mean, changes in variance). There are multiple methods for identifying changepoints in a dataset and some of them are conveniently implemented in the R package changepoint. Once you identify the change points, you have your clusters. Simply split the data into groups based on X and fit separate models. 
