Exploring Fitbit heart rate data with Gaussian mixture models

Apr 27, 2016 · 267 words · 2 minutes read fitbitgaussian mixture models

The Fitbit Charge HR captures heart rate using LED lights on the tracker to detect blood volume changes. Measurements are taken every 5 seconds and averaged into 5 minute bins.

The graph below shows the distribution of my heart rate (bpm) for several days in April 2016. The histogram reveals a bimodal distribution with centers around 58 and 80 bpm. The centers were identified using a Gaussian finite mixture model fitted by the expectation-maximization (EM) algorithm and are marked with vertical dotted white lines.

Heart Rate Histogram

Graphing heart rate across time shows a consistent temporal trend. Heart rate is lower at night while sleeping (50-60 bpm) and is higher during the day. Variability is also larger during the day.

Heart Rate Time Series

I don’t know that Fitbit uses Gaussian mixture models but it would make a lot of sense. GMMs are a type of latent variable model. In this case the latent variables may represent sleep vs. awake. GMMs provide soft clustering which allows the same heart rate value to be classified as either “asleep” or “awake”.

Applying the model to a new day of data (Apr. 8) correctly identifies the two states correctly (by visual inspection).

Heart Rate Time Series Classified

Fitbit calculates resting heart rate as “the heart rate measured when you’re awake, calm, comfortable, and have not recently exerted yourself.” Having identified sleep vs. awake it is now possible to calculate resting heart rate and other summaries from the data. For example the first quantile for my awake heart rate was 73 bpm and third quantile was 89 bpm. The first and third quantile for my asleep heart rate was 56 and 60 bpm.