Weight averages with the time between data points
Opened this issue · 1 comments
A simple average over data points assumes even intervals, but people likely do not log data at regular intervals.
One such case is logging mood changes you notice. Assume you have a good mood in the morning (1), then you log bad mood because of some bad event (0), and a few minutes later, you log good mood again (1) because it turns out it wasn't that bad. Then the average will be 2/3
, even when it was a very good day.
I'd like to suggest looking into some more options for handling averages:
- Weighting by time to the next change
- Maybe using the median for some diagrams instead of the average
- Using the variance to help to understand the average (maybe some form of error bars?)
It is important to consider that the range data points do not have a length associated, so it is not guaranteed that the next data point represents the end of a period with a constant value, but it is a better approximation than the simple average. When someone really wants to correct some in-between point, it is still possible to add a new data point and change its time.
Another thought: Averaging vom 00:00 to 23:59 is for many trackers not so useful. Think of for example going to bed in a bad mood and waking up in a good mood.
For this it would be good to specify custom intervals, e.g. 9am to 1am on the next day for the averaging. Perfect would be combining sleep time tracking and separating days, but as far as I understand your data structure this is probably not easy to add.
Yet another idea would be to use some kind of sliding window (maybe with exponential decaying weights?) for the averages.
This are just a few thoughts I had, I am not sure which approaches are useful. But I think some approach to define the average over days separated by sleeping time would be useful.