1
$\begingroup$

I have two animal running trajectories. A regular one with repeated back and forth running between point A and B, like the one on top in the figure. The other one is very irregular, animal paused and turned around a lot in the middle. Is there any algorithm to measure the regularity of a trajectory, like repeated activity on the top? And compare the extend of regularity between the two trajectories? Thanks in advance. enter image description here

$\endgroup$
  • $\begingroup$ Whatever algorithm you use or come up with, I think the first part must necessarily be to describe in words -- and then in conceptual terms that can be implemented -- what exactly it is that you mean by "regular" and "irregular". These are broad words that mean many different things in different contexts, and it is an important part of science to define what exactly one means if you call a path "regular" or "irregular". This is also important because, once you describe what the characteristics of such paths are, you already have something that you can measure. $\endgroup$ – Wolfgang Bangerth Aug 1 '14 at 8:54
  • 1
    $\begingroup$ I think this is part of the question itself! If the asker already had "conceptual terms that can be implemented" then we could just tell them to google those terms or to read about them on Wikipedia. $\endgroup$ – k20 Aug 1 '14 at 15:32
  • $\begingroup$ Cross posted at math.stackexchange.com/questions/884039/…, biology.stackexchange.com/questions/20114/…, and physics.stackexchange.com/questions/128968/…. (Please don't do that: People can give much better answers if they can see what other users have already suggested and whether that helped you.) $\endgroup$ – Christian Clason Aug 1 '14 at 17:31
0
$\begingroup$

One possibility is measuring the change in slope at each point in the trajectory and then taking the average at the end. In the first one which you've described as "regular" the slope remains constant for a good part of it. That's not the case in the second one which is "irregular".

So at each point in the x-y trajectory find the change in slope and then take the average. At the end the a more "regular" trajectory will have an average change closer to 0 (because the animal walks in a straight line for a good part of it, so his "slope" is constant). Here is some example code.

change_in_slope = 0.0
for i in 2:no_points-1
    change_in_slope += (y[i] - y[i-1])/(x[i] - x[i-1]) - (y[i+1] - y[i])/(x[i+1] - x[i])
end
change_in_slope = change_in_slope / (no_points - 2)
$\endgroup$
1
$\begingroup$

There are ways to check periodicity in a signal. If you estimate the most likely frequency and approximate the per-period behavior then if you detect that it is a nearly exact match for every period, this would be evidence of a kind of regularity.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.