habitus-eu / hbGPS

R package to process GPS data collected in human behaviour with option to merge/utilise time series from accelerometer data
Apache License 2.0
2 stars 0 forks source link

Running hbGPS without accelerometer data: Interpretation of "mot" in Output File #26

Open yeonghohwang opened 1 month ago

yeonghohwang commented 1 month ago

Hello Vincent,

Thank you, as always, for your helpful responses regarding the use of hbGPS. I am writing to inquire about interpreting the mode of transportation (mot) in the output generated when running hbGPS without accelerometer data.

I am using GPS raw data collected at 15-second epochs with a Qstarz GPS device. Additionally, I generated the output file using the following code.

hbGPS(idloc = 2, gps_file = "C:/Users/Epi/Desktop/hbGPSdata", outputDir = "C:/Users/Epi/Desktop/hbGPSoutput", GGIRpath = "C:/Users/Epi/Desktop/GGIR/output_GGIRdata/meta/ms5.outraw", # Empty folder outputFormat = "notPALMS",
time_format = "%Y/%m/%d %H:%M:%S", tz = "America/Edmonton", AccThresholds = "default", # Because it runs hbGPS without accelerometer data maxBreakLengthSeconds = 120,
minTripDur = 60,
minTripDist_m = 100,
threshold_snr = 250, # SNR threshold 250: If SNR exceeds 250, the location is outdoors. threshold_snr_ratio = 0) # SNR_RATIO is not used to distinguish between indoor and outdoor locations.

Referring to “4. Describing trips and their segments” in the documentation, it is understood that the mode of transportation (or trip mode) is based on the 90th percentile speed thresholds of 1, 10, and 35 km/h for walking, cycling, and vehicle, respectively, for specific segments.

Based on the output produced by my R code, it seems that the thresholds of 1, 10, and 35 km/h are applied to each individual data point (one observation per 15-second epoch) rather than the 90th percentile speed of segments containing two or more data points. In other words, each segment appears to consist of just one data point collected every 15 seconds, with changes in state and segment occurring every 15 seconds.

I would appreciate your advice to confirm if my understanding is correct. For your reference, I have attached a portion of the anonymized hbGPS output that was generated. (Note: Only the variable names (column headers) from the raw data captured by the QStarz GPS device have been retained, with the underlying data removed. Following comprehensive discussions, the anonymized file will also be securely deleted.)

Thanks, Yeongho Testfile_hbGPS.csv

vincentvanhees commented 3 weeks ago

I think you are confusing states for segments. Each epoch has a state and this can indeed change from epoch to epoch. However, with this sequence of epochs hbGPS identifies segments which reflect for example a trip or a break in a trip.

yeonghohwang commented 3 weeks ago

Hello Vincent, Thank you for your kind response! I had the opportunity to explore further, and my understanding of trip detection is now very clear. However, I have a few additional questions regarding trip description.

trip number 9

  1. Based on my understanding, it seems that multiple segments can exist within a single trip. That is, whenever there is a change in state within the trip, a new segment is generated. For example, in the presented hbGPS-processed data (trip number 9; the trip identified as number 9 in my dataset), it appears that there are a total of 15 segments. Could you confirm if my understanding is correct?

  2. Trip number 9 has a duration of 435 seconds (approximately 7 minutes), and the 90th percentile speed is estimated at 47.49 km/h. However, not all epochs are classified as mot = 3 (Vehicle). I assume this is because different states and speeds are present across the 15 segments. As a result, the trip shows varying state and mot values. My question is whether it aligns with the design of the trip description in hbGPS that a single trip duration of 435 seconds can include mot values of 1 (Walking), 2 (Biking), and 3 (Vehicle).

Thank you again for your guidance, and I look forward to your thoughts on this.

Best regards, Yeongho