Categories
Digital Health

Relationships between HRV, sleep and physical activity in personal data

In May 2019, I bought an Oura ring. For my PhD study, measuring sleep and resting heart rate variability (HRV) are important variables, but there are few consumer wearables that accurately measure both. Since the Oura ring was concluded to be valid to measure both sleep and resting HRV, I was curious to test it out for myself. After wearing it for a bit more than a year, I thought it would be nice to crunch some numbers and share my insights here. In the Quantified Self community, structuring your talk based on the three questions “What did I do?”, “How did I do it?” and “What did I learn?” is recommended. I’ll follow suit.

What did I do?

Ever since learning about the power of HRV as a biofeedback tool during my first physiotherapy internship in 2006, I’ve been intrigued by it. HRV biofeedback is probably most well-known in the context of meditation, mindfullness or breathing exercises, for instance using the HeartMath method. Since HRV drops during stress and increases during relaxation, it can be a powerful tool to use during therapies aiming for the latter. I actually wrote my graduation thesis as a physiotherapist on that subject in 2007 and applied the techniques at my job as a physiotherapist.

However, tracking your resting HRV over time also can be interesting. Since HRV is a proxy for autonomous nervous system functioning, it could provide insight into what your body is up to. Is your body under physiological or psychological stress, or is it well rested and prepared to face new physical and mental demands?

There are indications that having a lower resting HRV can be associated with mental stressovertrainingsicknessalcohol consumption or inactivity. On the other hand, there are also indications that having a low resting HRV itself is also associated with increased sensitivity for stress, suboptimal emotion regulation, decreased physical capacity and performance and an increased risk at (psycho)pathologies.

While these referenced studies investigated the between-subject differences by looking at a group of people and test if certain characteristics differed amongst individuals, my own PhD study looks at within-subject differences in resting HRV and other variables. Could a gradual decline in my own HRV also be an indication of accumulating mental exhaustion, and does such a trend mean I’m getting low on resources to be mentally resilient?

This blogpost actually doesn’t go into that – that’s what my PhD study is for. What I will do here, is use my own personal Oura data to explore possible relationships between my own resting HRV, sleep and physical activity. Does my resting HRV indeed drop after exercise, and do I sleep better after being physically active? Are my sleep and HRV themselves interrelated, and does the longer-term trend in my HRV data tell me something about myself?

How did I do it?

The data collection is rather straightforward: just wear the Oura ring (version 2), both during the day and night, and make sure to charge it once every 5 days. The data was collected between 11-05-2019 and 22-09-2020, good for 501 subsequent days of resting HRV, sleep and physical activity data without missing values.

Resting HRV, which the Oura ring measures during the night, is expressed in the Root Mean Square of the Successive Distances (RMSSD) in milliseconds, which is arguably the best HRV time-domain measure to use since it is particularly associated with parasympatic activity. For sleep I’ll use the Total Sleep Time (TST) in hours. Physical activity is expressed in the minutes spent sedentary or in light, moderate or vigorous physical activity, or the aggregated measure Moderate-to-Vigorous Physical Activity (MVPA) that is used in international physical activity guidelines.

I exported my data via the Oura cloud dashboard, which gives you a convenient .csv file that you can use in pretty much any datamanagement software. For data-management and analysis, I’ve used R version 4.0.2 and RStudio version 1.3.1073. For statistical analysis, I’ve used (multiple) linear regression analysis and ARIMA (AutoRegressive Integrated Moving Average) models.

If you’re not into statistics don’t worry, I’ll explain the results in plain English as well.

What did I learn?

I’ve uncovered five key insights that I would like to share here.

1. My resting HRV is low after exercise or being sedentary

To assess how physical activity and sedentary time influence my resting HRV, I created a multiple linear regression model. Below I’ll share the statistical model and its corresponding diagnostics.

Multiple linear regression model of sedentary, light, moderate and vigorous physical activity minutes on resting HRV.
Model diagnostics.

These results show that my resting HRV tends to be lower after days with a higher number of minutes spent in moderate or vigorous physical activity, but also on days with a high number of sedentary minutes. Of the three, moderate physical activity had the most negative impact (lowest coefficient in the ‘Estimate’ column), followed by vigorous physical activity and then sedentary time. All-in-all, 9.4% of the variance of my nocturnal resting HRV could be explained by my daytime physical activity.

These findings are consistent with prior literature, in which resting HRV has also been negatively associated with sedentary time and physical exercise.

However, that exercise negatively impacts my resting HRV during the subsequent night doesn’t mean that exercise can’t be beneficial for my HRV on a larger timeframe. There are actually many studies that have shown that individuals that are more physically active tend to have a higher resting HRV (1, 2, 3, 4, 5). A possible causal pathway for this could be that exercise improves the aerobic capacity (VO2max), which has been linked to resting HRV. That brings me to the next topic.

2. My resting HRV changes on a larger timeframe seem to be related to my recent lifestyle changes

The evidence presented here will be rather anecdotally, but for me personally the most clear and interesting finding that I’m presenting here. The graph below simply shows my resting HRV over time. Since HRV can differ a lot on a day-to-day basis, I’ve used the 7 day rolling average here to filter out the day-to-day noise that I’m not interested in here. This means that every observation you see is the average HRV of the past 7 days.

A graph of the 7-day rolling average of my resting HRV in RMSSD (ms) over time.

You don’t have to be a statistician to see that my resting HRV changed quite a bit over time during the past year. As the title of this paragraph already suggested, these changes can at least partially be explained by my exercise behavior.

The years 2016-2018 (not depicted here) were very demanding for me on many fronts, after which I felt quite mentally and physically exhausted. Early 2019, several inconveniences related to my youngest (then baby) daughter resolved, and in general my personal vigor levels started to restore. In January 2019, I bought my first race bike and started cycling. My physical fitness clearly improved during that period, which can be associated with the rising trend in my resting HRV that can be seen in the graph.

Starting September 2019, my work-related demands increased and I decided to prioritize those over exercising. I caught a virus two or three times during that period, and my resting HRV clearly declined.

December 2019, I realized that I was in a clear negative trend that I needed to break out of. After being inspired by Matthew Walker’s Why we sleep, I started to change several lifestyle habits in an attempt to improve my sleep quality and duration. I stopped drinking coffee and alcohol, started limiting my refined sugar intake, simply prepared for bed earlier and restarted my meditation and cycling routines.

My resting HRV already slightly recovered early 2020, but really started to change after I decided to ‘tighten the knots’ a bit circa March 2020, when COVID-19 emerged in the Netherlands. Around that time I also started to increase my sun exposure, primarily because I wanted to see if it would improve my psoriasis (a heredetary skin condition) symptoms (it did!), but also because there were signs that vitamin D deficiency could be a risk factor for COVID-19 related complications. For maximum efficiency to combine vitamin D related sun exposure and exercise, I simply went out to cycle during solstice (when the sun is at its highest point) when possible.

As can be seen in the graph, my resting HRV really found a rising trend after that and is now consistently twice as high as during the late 2019 dip. My physical condition improved greatly, I lost a fair bit of weight and my self-perceived capacity to concentrate and more flexibly adjust to demands increased a lot, despite that period being highly demanding due to having to work from home while our kids couldn’t go to school and day-care.

Due to the variety of lifestyle changes that I underwent during this period it is impossible to point out a single one as being the most dominant. Either way, I found it extremely intruiging to see that my resting HRV graph over time so accurately seems to have caught the quite dramatic change in overall health and well-being that I have perceived over the past year. To me, it reinforces my (substantiated) hunch that resting HRV could be a very useful proxy for this.

The multiple regression analysis I performed first only looks at within-day relationships. When you want to assess multi-day trends, time series analysis could be a useful approach. Last year I followed the Practical Time Series Analysis course of The State University of New York that is available on Coursera. While I am still very new to and inexperienced in time series analysis, I was able to apply it on my own HRV data and find something useful.

3. My resting HRV can be (partially) predicted based on its prior values

In my PhD study, one of the things I’m researching is whether resting HRV can be used to detect a possible vicious cycle. After all; if stress and mental exhaustion decrease resting HRV and a lower resting HRV results in sub-optimal threat appraisal and emotion regulation, a feedback loop can be formed. If this is indeed the case, you would expect to see a relationship between resting HRV and its prior (lagged) values.

To assess this, I’ll create an ARIMA (AutoRegressive Integrated Moving Average) model using the astsa package in R. To do so, we’ll first take a look at the AutoCorrelation Function (ACF) and Partial AutoCorrelation Function (PACF) graphs.

Autocorrelation Function (ACF) and Partial Autocorrelation Function (PACF) graphs of my personal daily HRV data.

According to this interpretation of the ACF plot, there is a 3rd order Moving Average (MA) term present in my resting HRV data. I found the interpretation of the PACF plot a bit more challenging. There are clearly 7 lags that are statistically significant (the first 7 vertical lines cross the blue striped line), but after reading this, the form of the current PACF just seems to suggest that an MA term is present.

After applying the auto-ARIMA function of the astsa package, it concluded that an ARIMA (3,1,1) model was the best fit:

An ARIMA (3,1,1) model for my resting HRV data.

An ARIMA (3,1,1) model means that both an AR term of the third order, as well as an MA term of the first order, are present, and that both are first order integrated. In an attempt to (probably over-)simplify this, you could say that my resting HRV can be predicted using the values of the previous 3 days.

Now that I have a model that can predict my resting HRV using values of the past few days, I could technically also predict my resting HRV during the next few days. Using the forecast R package, this would look like this:

Forecast of my resting HRV based on an ARIMA(3,1,1) model.

As you can see, this forecast is not very useful at all, since the 90 and 95% confidence bands are very wide, as large day-to-day variations in resting HRV are very common.

What I’m personally taking out of all of this, is that my initial hunch that resting HRV might indeed be useful as a potential proxy for the type of feedback loop that we hypothesized in my PhD trajectory is reinforced. Analysis of one of the studies that we performed over the past two years also show signs of this, which we’ll be submitting at a peer-reviewed journal soon. However to statistically explain the actual longer-term trends in HRV data, more variables need to be included in the time series analysis. This is going to be the topic of an upcoming study for which we’re collecting data at the moment as part of my PhD trajectory.

4. My nocturnal HRV may be associated with sleep

To test if my nocturnal HRV is associated with my TST, I created a linear regression model:

Linear regression model of nocturnal HRV by TST.
Model diagnostics.

Simply put; yes, there appears to be a positive association between my TST and nocturnal HRV. This means that my nocturnal HRV tended to be higher during nights where I had a higher TST. However, TST explains just 1.7% of the variance in nocturnal HRV, so the association is rather weak. Also, it is important to note that since both variables are simultaneously collected (cross-sectional), no causal inferences can be made here. It is well possible that this weak effect can be explained by another variable (e.g., alcohol consumption, that could negatively influence both sleep and HRV) that isn’t included in this model.

Consumer wearables tend to be fairly accurate to measure TST but less accurate in measuring sleep stages. This also applies to the Oura ring. Nonetheless, I was curious to see to what extent my HRV is associated with the time spent in the seperate sleep stages, so I created the following model:

Multiple linear regression model for HRV by sleep stages.
Model diagnostics.

These results clearly show that my nocturnal HRV is very much associated with the time spent in the four sleep stages. My HRV particularly tends to be a bit higher during nights where I spent a lot of time in deep sleep, and a bit lower during nights with a relatively high amount of time spent in REM sleep. The time spent in the four sleep stages explain a whopping 48.2% of the variation in my nocturnal HRV data.

While this finding appears to be very substantial and exciting, the most likely explanation for this provides a bit of an anti-climax. Since variation in HRV has been linked to sleep stages in prior literature and nocturnal HRV is one of the few physiological resources (besides heart rate itself, body movement, body temperature and the estimated respiratory rate) that the Oura ring can use to classify sleep stages, it is very likely that it used nocturnal HRV data to classify these stages. If that is the case, a high correlation between HRV and these sleep stages is a logical consequence of the applied algorithm.

To finish off, there is one more association in my Oura data that I wanted to explore. Are my sleep and physical activity related?

5. I sleep longer on days with more physical activity or low sedentary time and am more sedentary after short nights

To assess to what extent the four physical activity related variables (minutes sedentary, light-, moderate- and vigorous physical activity) explain my TST I first naively created a multiple linear regression model. However, due to significant correlations between time spent in these physical activity intensities, problematic multicollinearity arose, which means that approach doesn’t work.

As an alternative, I simply assessed all relationships by themselves (univariately) and found three interesting associations. The first model I’ll present predicts TST based on MVPA:

Linear regression model for MVPA on TST.
Model diagnostics.

This result shows that I tend to sleep longer after days with higher MVPA, where MVPA explains 1.9% of the variation of TST. The model diagnostics show that the distribution of my daily MVPA observations causes some problems with the distribution of the model residuals. However, since this finding is consistent with prior literature that suggests that MVPA has a small positive effect on TST, I am fairly confident that ‘where’s smoke, there’s fire’ here.

The following model predicts TST based on sedentary time:

Linear regression model for sedentary time on TST.
Model diagnostics.

So as it turns out, I also sleep better after days with relatively low sedentary time. This was to be expected, since I already mentioned that MVPA and sedentary time are significantly correlated (r=-0.41, p<e-06). Nonetheless, it shows that sedentary time by itself also is a significant predictor of low TST, and actually explains more of the variance in TST than MVPA did (5.4% compared to 1.9%). While there isn’t as much literature on this as there is available for MVPA, a recent study reported a negative bi-directional relationship between sedentary time and TST.

This brings us to the final relationship that I wanted to share. Like the aforementioned study, I am apparently also more sedentary on days after a short night:

Linear regression model for TST on sedentary minutes.

On a fun statistical sidenote; when you compare the ‘Non-Normality of Residuals’ plot on the upper right side to that of the previous one, you can see that using TST as a predictor for sedentary time is a lot less problematic (the curve is much more ‘normal’; closer to the green line) than using sedentary time as a predictor for TST. This is because my TST is relatively stable at around 7 hours and varies to both the up- and downside (though mostly downside, as can be seen in the longer left-tail of the Non-Normality of Residuals plot). On the other hand, on average I am quite sedentary (e.g., fulltime desk job) and variations are by far the most to the downside (e.g., taking care of my kids or longer bike trips during the weekend).

Final remarks

For me this was a fun exercise. While none of the relationships I presented here are all that surprising to me fundamentally, there’s always something very powerful when you do so using your own personal data. Of course this is exactly what the Quantified Self is all about. A personal takeaway for me is the reinforcement that being physically active and limiting sedentary time apparently help me to sleep better and have a higher resting HRV.

After losing weight during the COVID-19 period, my Oura ring has gotten a bit too big, which has become a bit annoying during the day. Since I also wanted to have a smartwatch that I can pair with an external chest strap and listen offline podcasts on during exercise (I’ve also picked up running lately as I’ve been waiting for my race bike to be fixed for a few weeks now), I recently picked up the new Apple Watch 6. I’ll still wear the Oura ring during the night to continue tracking my sleep and resting HRV, but I’ll use the Apple Watch to track physical activity during the day. Based on the findings presented in this blog post, I think I’ll try and commit to filling the three physical activity rings (red: calories, green: MVPA, blue: non-sedentary hours) on a regular basis!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.