Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

conceptual Q: mt_align_start_end()

Hi,

I would like to use mousetrap to analyze how people navigate between landmarks on the screen using the keyboard/mouse -- this means that the start and end points are not the same, so if I understand correctly, I would need to spatially normalize each trajectory so that they start and end at the same coordinates?

I have two questions:

  1. Should you do spatial normalization before or after you do "temporal"/sampling point normalization?
  2. I have tried both before and after, but mt_align_start_end() gives me the error: " stats::approx(trajectories[i, , timestamps], trajectories[i, :  need at least two non-NA values to interpolate". I have checked that the number of logged positions for all trials > 2

This leads me to believe that perhaps I am missing something conceptually about what the function does and how I should approach preprocessing my type of data?


Any help and advice much appreciated!

Gina

Comments

  • Hi Gina,

    I would like to use mousetrap to analyze how people navigate between landmarks on the screen using the keyboard/mouse -- this means that the start and end points are not the same, so if I understand correctly, I would need to spatially normalize each trajectory so that they start and end at the same coordinates?

    that depends on a) how your task looks specifically and b) what analysis you would like to perform afterwards. Regarding a): your task (navigating landmarks) sounds as if the movement patterns are quite different between trials and therefore an alignment might not make sense. However, I would need to know more about the task to be able to give a more specific response.

    Should you do spatial normalization before or after you do "temporal"/sampling point normalization?

    This should not make a difference. However, it probably makes more sense before, as you probably would prefer that all analyses are later on based on the start and end point aligned trajectories (both analyses that are based on the raw data and on the time normalized data).

    I have tried both before and after, but mt_align_start_end() gives me the error: " stats::approx(trajectories[i, , timestamps], trajectories[i, : need at least two non-NA values to interpolate". I have checked that the number of logged positions for all trials > 2

    This error message is probably produced by the mt_time_normalize function (as mt_align_start_end does not use stats:approx internally). If you have checked that all trials have more than 2 logged positions, the only idea I have is that this error occurs if you use mt_time_normalize after mt_align_start_end and that in your task in some trials the start and end point is identical and therefore the alignment leads to NAs/Inf values (in this case it might not make sense to use mt_align_start_end at all - which also relates to my point a) above). However, this is just a speculation.

    Best,

    Pascal

  • Hi Pascal,

    Thanks for the prompt reply (I was half-thinking I would get an email alert for posts to the thread, hence the delay on my end).

    In our task, people have to put back objects where they have found them -- they are prompted with a random object from the location where they put back the previous object. So, yes, the movement patterns can be quite different. I would like to look at metrics that reflect sinuosity, direction switches on both axes in our 2D environment, and deviations from the ideal "straight line" from the previous object to the next object (as well as total distance covered -- but for this metric I'm thinking it would make sense to only calculate it on the "temporally" normalized trajectories), so I thought that for what I would like to compare, it would make sense to align the starts and ends because I don't care what the distance between different objects is. I guess, short of spatially normalizing the trajectories, I could delineate all the possible "ideal"/straight-line trajectories between all location possible locations, but I thought "normalizing" spatially would help me get around having to do this.

    Given that we never prompt the same object in a row and all objects are in distinct locations in a "biggish" environment, so I don't think it is very likely that the start and end points are identical. Got any other ideas?

    Much appreciated!!

    Gina

Sign In or Register to comment.