# FAQ

## About the Metrics

*Q: What do the different metrics mean?*

A: The **avg** is, surprisingly enough, the average of your sleep per day. But that doesn't account for consistency of sleep at all. So the **stDev** is the standard deviation of your sleep per day. (Note that it uses sample standard deviation, using the formula Wikipedia suggests.) This doesn't account for sleeping enough, so the **zScore** is one simple way of combining them: it's the average minus the standard deviation. Both still penalize you for sleeping a lot in some cases, so **posStDev** and **zPScore** only count the negative deviations from the mean in computing the metrics.

Another way of accounting for consistent sleep is to have some sort of diminishing returns on sleeping a whole lot on a single day. So consider some concave-down increasing function *f*. (We stipulate increasing to make it so that sleeping more always increases your score, a property that the zScore unfortunately doesn't satisfy.) Now apply *f* to your sleep each day, average those values, and then take *f*^{-1} of the average, in order to make the answer correspond roughly to hours of sleep. If we take *f*(*x*)=√*x*, this gives us the **avgSqrt** metric, which we can also think of as the 0.5-power mean. If we take *f*(*x*) to be log *x* or 1 - 1/*x*, we get the geometric or harmonic respectively. Both would blow up when *x*=0, so we add an offset, currently 1 hour, then subtract it at the end. So **avgLog** has *f*(*x*)=log(*x* + 1 hour) and **avgRecip** has *f*(*x*)=1 - 1/(*x* + 1 hour). We don't have a great understanding of the qualitative difference between the three, to be honest, but they each penalize inconsistency a bit differently.

The **idealDev** measures your deviance from max(the amount of sleep you set as your ideal amount of sleep, the average amount of sleep you got).

The **consistent** metric measures how consistent the *times* when you slept were, not how consistent the length of your sleep was. This is the probability (multiplied by 1000) that if you pick a random point when you were asleep, and then pick a random day, you were asleep at that time on that day too. If you sleep at exactly the same time every day, your score will be 1000; otherwise, it will be less.

The **consistent2** metric also measures how consistent the times when you slept were. It's the probability (multiplied by 1000) that if you pick two random days and a random time, you will either be asleep on both days or awake on both days at that time. This metric doesn't penalize those who get less sleep for their inconsistent sleep times as much as consistent does.

The **cScore** metric is a way of combining amount of sleep with consistency: it's the product of avg and consistent. Another way to look at this is that it's an average of your sleep weighted by time of day, where the weight associated with a time corresponds to the probability that you were asleep at that time on a random day.

The **cScore1** metric is another way of combining sleep with consistency. This is the average of your sleep only counting when you were asleep at the same time of day twice in a row, or equivalently, how much your sleep times overlap from each day to the next. So named because it's a variant on cScore where the weight only depends on the times you were asleep on the previous day, rather than your distribution of sleep over all days.

*Q: Why are so many metrics gone? *

We removed some from being shown by default because we thought there were too many redundant metrics. You can choose which metrics are displayed in your profile settings.

*Q: Over what time period are the stats computed? And what's this exponentially decaying thing?*

A: The exponentially decaying average is a weighted average over all time, where the sleep from *n* days ago has a weight of 2^{-n/4}, i.e., the weights have a half-life of 4 days. This counts all sleep, but counts recent sleep (the last week or so) for the most. We also compute averages over all time ("global") and over the last 7 days ("weekly"). The leaderboard uses the exponentially decaying average.