# How to create clusters of position data?

I am asking this question because the previous one wasn't very helpful and I asked about a different solution for the same problem.

# The Problem

I have lateral positions, xcoord, of vehicles over time which were recorded as the distances from the right edge of the road. This can be seen for one vehicle in the following plot:

Each point on the plot represents the position of the front center of the vehicle. When the vehicle changes the lane (lane numbers not shown) there is a drastic change in the position as seen after the 'Start of Lane Change' on the plot.
The data behind this plot are like below:

  Vehicle.ID Frame.ID   xcoord Lane
1          2       13 16.46700    2
2          2       14 16.44669    2
3          2       15 16.42600    2
4          2       16 16.40540    2
5          2       17 16.38486    2
6          2       18 16.36433    2


I want to identify the start and end data points of a lane change by clustering the data as shown in the plot. The data points in the plot circled in red are more similar to each other because the variation between them is smaller compared to the data points in the middle which see large variation in position (xcoord).
My questions are: Is it possible to apply any clustering technique to segment these data so that I could identify the start and end point of a lane change? If yes, which technique would be most suitable?
I use R. I have tried Hierarchical clustering before but don't know how to apply it in this context. Please help.

• I don't think clustering is the best approach. Instead I suggest treating it as a time series. Prior to lane change, the x position will probably fit a stationary distribution. Lane changes could be detected by tests for non-stationarity. An even simpler approach would be trend change detection via moving averages or similar, as is done in technical stock market analysis. Sep 22, 2015 at 6:10
• Adding to AnonyMousse's answer and MrMeritology's comment, which I agree with, you can consider the following approaches: trend analysis (time series-based) and change point analysis (entropy-based or other). See my relevant answers and links within: on trend analysis and on change point analysis. Sep 22, 2015 at 7:16
• Could you please recommend resources for R to implement these techniques? I have never used these before. Sep 22, 2015 at 12:09