change the range of measures (e.g., 0-25, 26-50, 51-75, 76-100 ranges)
Hi:
In mousetrap, mt_measures gives us various measures in a time_normalized format (e.g., AUC in a 0-101 time-standardized trajectory).
How can I segment a time-standardized trajectory (tn_trajectories) into, for example, four segments (e.g., 0-25, 26-50, 51-75, 76-100 ranges) and calculate various measures (e.g., AUC, MD, MAD) in each segment?
I can do this manually (e.g., dividing tn_trajectories into four segments, and then apply mt_measures to each segment). but is there any easy / ready-made function to do this?
Thank you
Takashi
Comments
Hi Takashi,
there is no mousetrap function that allows you to split a trajectory directly. However, you can do this yourself by only passing a selected range of positions to mt_measures:
However, this way the idealized trajectory will depend on the start and end point of each segment which can lead to strange results for MAD, MD_above, AUC and AD. Other measures like xpos_flips will work fine.
Alternatively, you can calculate the deviations from the idealized line directly for every position in the time-normalized trajectories using mt_deviations like below. Then, you can calculate the maximum and mean of these deviations for different segments which would correspond to the MD_above and AD for the segment.
Best,
Pascal