Just his past week, Marco Altini a prominent HRV advocate and researcher created a python based process to take an RR data series and output DFA a1/HR related values. Although python is not part of my skill set (as in the old Star Trek line - "I'm a doctor not a ...."), some friends at Suunto happened to be working on something similar and we decided to take a look. The idea was to test the "agreement" between the gold standard Kubios to that of a python derived DFA a1. To do so we used the Polar H10 recorded running ramp from the prior post. The RR time series was fed through a python based program with the following settings:
- Basic script from here
- DFA a1 package here
- This is not the software from Marco Altini's site but it does use many of the same Python tools
In summary, we have the same Polar H10 RR series, comparing Kubios (auto correction mode) with the Python method. I'm going to comment up front that artifact identification and correction methods are going to be different. This could have a major impact on DFA a1 values.
Time varying output (2 min windows with recalculation every 5 sec)
- If this looks like the graph from the last post, it's not your imagination. This is the same data, but now the Python derived DFA a1 is added in purple triangles.
- There is reasonable (but not perfect) tracking of each data point.
How does this look with regression analysis. Here is a pair by pair plot of DFA a1 at all values:
R squared is .85 which is decent (but not excellent) and the slope is .82 indicating possible bias.
This was confirmed in a Bland Altman analysis:
Aerobic threshold calculations
Does the 20% bias at DFA a1 < .75 affect the HRVT (the VT1 related heart rate variability threshold)?
- Not really.
- Although the values are different in the DFA a1 1.5 to .3 region, the HRVT is quite close, only about 2 bpm divergent. There was more of a differential with lines drawn from 1.0 to .3, but still within several bpm.
- Kubios is and remains a gold standard for HRV and DFA a1 calculation.
- The above python implementation seems (based on very limited data) to parallel that of Kubios.
- A time varying look at DFA a1 using python scripting has enormous potential to help guide ones training regime. Both a retrospective look at an exercise session as well as a real time mini app on a smartwatch or phone may even be possible. One of my wish list items is a simple green, yellow, red marker on your watch indicating what your last 2 minute DFA a1 result was (with some sort of "confidence indicator" for artifacts).
- Issues to be worked out include artifact identification and correction (not necessarily the same thing) and more validation study.
- Many thanks to Olli-Pekka Koistinen and the Suunto team for the python calculations and background scripting information.
- Thanks to Marco Altini for increasing awareness of nonlinear HRV related fractal correlation properties as a tool to help guide training intensity distribution and measurement of the aerobic threshold.
With the help of Marco Altini we now have another Python based implementation comparison. He was kind enough to take the exact RR series as above and put it through his HRV software based process and send me the resultant DFA a1 values. The following figures will compare the Suunto python method, Marco's method and of course the gold standard Kubios.
Bland Altman Difference analysis:
- The Python based algorithm used by HRV logger yields similar results as the method used by the engineers at Suunto to compute DFA a1.
- Although further study and verification is needed, this is an exciting development for athletic intensity modulation and zone identification.
- Thanks to Marco Altini for processing the above RR series file and developing an app for mobile DFA a1 computation.