Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document: Don't understand the time unit of summary statistics #263

Closed
YUHUINI1995 opened this issue Oct 27, 2024 · 12 comments · Fixed by #266 or #280
Closed

Document: Don't understand the time unit of summary statistics #263

YUHUINI1995 opened this issue Oct 27, 2024 · 12 comments · Fixed by #266 or #280
Assignees
Labels
documentation Improvements or additions to documentation question Further information is requested

Comments

@YUHUINI1995
Copy link

I'm having difficulty understanding the time units of the summary statistics listed in this documentation.

Could someone help me understand them? For example, what are the units of obs_duration and total_flight_time, and how can I convert them into seconds or minutes?

image
@YUHUINI1995 YUHUINI1995 added the bug Something isn't working label Oct 27, 2024
@YUHUINI1995
Copy link
Author

@hackdna Could you or your team member answer this question? Thanks!

@hackdna
Copy link
Member

hackdna commented Oct 28, 2024

@YUHUINI1995, thanks for reaching out. I think @GeorgeEfstathiadis should be able to answer these questions.

@YUHUINI1995
Copy link
Author

@hackdna Thank you.

@GeorgeEfstathiadis Could you help answer these questions?

@hackdna hackdna added documentation Improvements or additions to documentation question Further information is requested and removed bug Something isn't working labels Oct 28, 2024
@GeorgeEfstathiadis GeorgeEfstathiadis self-assigned this Oct 29, 2024
@GeorgeEfstathiadis
Copy link
Collaborator

@YUHUINI1995 the measures in the hourly summary file related to time and duration are all in minutes.

@YUHUINI1995
Copy link
Author

@YUHUINI1995 the measures in the hourly summary file related to time and duration are all in minutes.

Thanks. How about the daily summary file? Is it also in minute or in hour?

@GeorgeEfstathiadis
Copy link
Collaborator

The daily should be in hours.

@YUHUINI1995
Copy link
Author

The daily should be in hours.

Gotcha. Thanks for your reply.

@hackdna
Copy link
Member

hackdna commented Oct 29, 2024

Thanks @GeorgeEfstathiadis! Would you mind adding units to the relevant variables in the docs?

@JiaxinCCC
Copy link

Hi @GeorgeEfstathiadis,

I have a follow-up question. I generated the output file using the daily setting, and below is the result
image

As you can see, some values of obs_day and obs_night are larger than 12, which seems unusual given the definition provided on the website. Could you explain why this might be happening?

image

@GeorgeEfstathiadis
Copy link
Collaborator

Hi @JiaxinCCC, this is a bug which we would need to investigate. Can you share the study and participant Beiwe ID you used to get this summary file as well as the code script you ran? And then I can look into this further.

@JiaxinCCC
Copy link

Hi @JiaxinCCC, this is a bug which we would need to investigate. Can you share the study and participant Beiwe ID you used to get this summary file as well as the code script you ran? And then I can look into this further.

Hi @GeorgeEfstathiadis, thanks for your reply! I ran the code below using Python 3.11 and forest==0.1.1.

from forest.jasmine.traj2stats import Frequency, Hyperparameters, gps_stats_main

data_dir = "data/onnela_lab_gps_testing/"
output_dir = "gps_output_daily"
tz_str = "America/New_York"
frequency = Frequency.DAILY
save_traj = True
gps_stats_main(data_dir, output_dir, tz_str, frequency, save_traj)

The data was downloaded from this repository, based on this tutorial.

The ID is 6b38vskd under the folder onnela_lab_gps_testing. Let me know if you need any additional information.

@GeorgeEfstathiadis
Copy link
Collaborator

Hi @JiaxinCCC, I have created a PR to fix this bug (at least for the extreme values seen in row 1).

Some of these obs_day and obs_night can be a bit above 12 due to rounding errors. I.e. if there is an observed pause that starts at 6:45pm and ends at 7:10pm, it will count as 25 minutes of observed time at daytime (while 10 of those minutes were actually nighttime). This is why it is possible to see observed times be above 12 hours in day or night, but it shouldn't be too common, especially when dealing with real world data where missingness is more profound.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation question Further information is requested
Projects
None yet
4 participants