Lesson 19 of 20 · Level 4: Analyst

Nonlinear measures: DFA, entropy and what they add

Every measure so far asks how much the intervals vary. The nonlinear measures ask how the variation is organised: whether a long run of beats repeats its short runs (sample entropy) and whether its fluctuations look the same at every scale (detrended fluctuation analysis). They see something the others cannot, order, and this lesson works both out on the teaching recording before weighing what they have added in practice.

On this page 5 sections

Key takeaways

  • Shuffle the same intervals and SDNN does not move, RMSSD does, and sample entropy rises. The nonlinear measures measure order, not amount.
  • DFA α1 is the slope of fluctuation against box size over 4 to 16 beats: about 0.5 for random jitter, about 1 for the fractal pattern of a healthy resting heart, 1.5 for a random walk.
  • Sample entropy is minus the log of the chance that two matching runs of 2 beats still match at 3 beats. Low means regular; high means unpredictable. Short recordings make it unstable.
  • An α1 of about 0.75 during exercise marked the first ventilatory threshold in 15 men, and post-infarction cohorts used cutoffs near 0.65 to 0.75.
  • The ESC and EHRA position paper's verdict: the new methods complement the 1996 measures and have not replaced them for clinical risk.
After this lesson you can
  • Explain in words what sample entropy and the DFA exponents measure, and compute each from its formula.
  • State what α1 is for white noise, 1/f noise and a random walk, and where healthy resting recordings and hard exercise sit.
  • Say what the nonlinear measures add to the time and frequency measures, with the shuffle test as evidence.
  • Summarise the ESC position paper's verdict and apply it to a device that advertises complexity.

Every measure so far asks how much the intervals vary. The nonlinear measures ask how the variation is organised: whether a long run of beats repeats its short runs ( sample entropy Sample entropy How unpredictable the heartbeat series is: minus the log of the chance that runs of beats that match also match one beat longer. Near 0 is a repeating pattern; 2 or more is close to random. More about Sample entropy ) and whether its fluctuations look the same at every scale ( detrended fluctuation analysis DFA α1 The short-term scaling exponent of detrended fluctuation analysis. Near 1 the beats have memory at every scale; near 0.5 they behave like noise. α2 is the same slope over longer stretches. More about DFA α1 ). They see something the others cannot, order, and this lesson works both out on the teaching recording before weighing what they have added in practice.

The shuffle test

Take the teaching recording’s 341 intervals and shuffle them into a random order. The histogram is unchanged, so the mean is unchanged and SDNN SDNN The standard deviation of all NN intervals in a recording, in milliseconds. It measures overall variability, and its value depends strongly on how long the recording lasts. More about SDNN is unchanged: 28.7 ms before, 28.7 ms after. Everything built on neighbours moves. RMSSD RMSSD Root mean square of successive differences: an HRV metric built from how much each heartbeat interval differs from the next, in milliseconds. It mainly reflects vagal activity. More about RMSSD goes from 33.4 ms to 39.6 ms, because the smooth breathing swing has been broken into random jumps. Sample entropy goes from 1.67 to 2.22: the series has become less predictable.

That is the whole case for the nonlinear measures in one experiment. Variability has an amount and a structure. SDNN and the band powers measure the amount. Entropy and DFA measure the structure. You can try a hand-sized version below: retype the ten beats in any other order and watch what RMSSD does, knowing the mean and SDNN cannot move.

RMSSD step by step

Ten beats, every number shown

The ten intervals, in ms (300 to 2000)

RMSSD of these 10 intervals is 26.9 ms.

Step 5 of 5

  1. Step 1 of 5 Start with the intervals

    Beat 1880 ms
    Beat 2826 ms
    Beat 3812 ms
    Beat 4823 ms
    Beat 5848 ms
    Beat 6877 ms
    Beat 7880 ms
    Beat 8866 ms
    Beat 9828 ms
    Beat 10815 ms

    10 intervals between 11 beats, in milliseconds.

  2. Step 2 of 5 Subtract each interval from the next

    Beat 2 − beat 1−54 ms
    Beat 3 − beat 2−14 ms
    Beat 4 − beat 3+11 ms
    Beat 5 − beat 4+25 ms
    Beat 6 − beat 5+29 ms
    Beat 7 − beat 6+3 ms
    Beat 8 − beat 7−14 ms
    Beat 9 − beat 8−38 ms
    Beat 10 − beat 9−13 ms

    Plus means the heart slowed down for a beat; minus means it sped up.

  3. Step 3 of 5 Square each difference

    Difference 12916
    Difference 2196
    Difference 3121
    Difference 4625
    Difference 5841
    Difference 69
    Difference 7196
    Difference 81444
    Difference 9169
    Sum6517

    Squaring makes every value positive and gives big changes more weight.

  4. Step 4 of 5 Average the squares

    6517 ÷ 9724.11
  5. Step 5 of 5 Take the square root

    √724.1126.9 ms

    RMSSD 26.9 ms

With JavaScript on, the steps show one at a time and the beats can be changed.

RMSSD worked out from ten beats of the teaching recording, one step at a time. Change any beat and every step updates.

A row of ten editable heartbeat intervals in milliseconds, then the calculation of RMSSD as numbered steps: start with the intervals; subtract each interval from the next; square each difference; average the squares; take the square root. The final step reads RMSSD 26.9 ms. Back and Next buttons move between the steps.

Sample entropy: how predictable is the next beat?

Sample entropy asks a plain question. Take every run of mm consecutive intervals (Kubios and most papers use m=2m = 2). Call two runs a match when every pair of corresponding intervals differs by less than a tolerance rr, usually 0.2 times the standard deviation of the series, which on the recording is 5.7 ms. Count the matching pairs of runs, BB. Now extend each run by one beat, to m+1m + 1, and count how many of those pairs still match, AA. Sample entropy is

SampEn(m,r)=−ln⁡AB\mathrm{SampEn}(m, r) = -\ln\frac{A}{B}

Read it as: minus the log of the chance that two runs which have matched for two beats go on matching for a third. If the series repeats itself, most matches continue, A/BA/B is near 1 and SampEn is near 0. If the next beat is anyone’s guess, few matches continue and SampEn climbs above 2. The recording’s SampEn is 1.67; shuffled, 2.22.

Richman and Moorman (2000) defined it to fix a flaw in its predecessor, approximate entropy Approximate entropy The older cousin of sample entropy, with no unit: a regularity measure that counts each run of beats as matching itself, which biases it towards low values on short recordings. More about Approximate entropy (ApEn), which Pincus (1991) introduced: ApEn counts each run as matching itself, which biases it towards regularity, most of all on short series, and makes it inconsistent as the tolerance changes. SampEn excludes self-matches. Their abstract reports that SampEn “agreed with theory much more closely than ApEn over a broad range of conditions”. On the recording ApEn is 1.02, lower than SampEn, as the bias predicts. Kubios reports both with m=2m = 2 and r=0.2r = 0.2 SD by default and computes them on the detrended series (Kubios HRV User’s Guide, 2021).

Two cautions. The entropies compare every run with every other, so short recordings give unstable values. Pincus (1991) suggested ApEn needs about 1000 values; Shaffer and Ginsberg (2017) note that SampEn can be computed from fewer than 200, but in the ultra-short study they review, SampEn needed 3 minutes to track the 5-minute value. This site’s calculator waits for 200 beats. And rr scales with the standard deviation, so a change in SDNN changes the yardstick: a series can score the same entropy at a different amount of variability, which is the point, and also a trap when comparing people.

How predictable is the next beat?

Five minutes of the teaching recording

SampEn
1.67
ApEn
1.02
Tolerance r
5.7 ms
m matches
13
m+1 matches
1

Rested, m = 2, r = 0.20 × SD = 5.7 ms. The highlighted run of 2 beats matches 13 other runs within 5.7 ms; 1 of them still matches when both runs are one beat longer. Counted over every run in the recording, sample entropy is 1.67: the breathing rhythm makes the next beat partly predictable.

The controls work when JavaScript is on.

The first 64 beats of the teaching recording. One run of m beats is highlighted with a band of ±r around each beat; every other run that stays inside the band is a match, and the darker boxes are matches that still hold one beat longer. Sample entropy (SampEn) is minus the log of the share of matches that survive, counted over the whole recording; approximate entropy (ApEn) is its older cousin. Change m and r, or switch to a periodic or a random series.

A line chart of 64 heartbeat intervals in order. A highlighted box marks a template run of m beats with a tolerance band of plus or minus r milliseconds around each of its beats; lighter boxes mark other runs of m beats that match the template within the band, and darker boxes those that still match when both runs are one beat longer. Readouts give sample entropy, approximate entropy, the tolerance in milliseconds, and the two match counts, followed by a sentence explaining them. Two sliders set m (1 to 4 beats) and r (0.1 to 0.6 times the standard deviation); three buttons choose a periodic series, the rested recording or random beats.

Detrended fluctuation analysis: does the pattern repeat at every scale?

Peng and colleagues (1995) introduced DFA to test whether heartbeat fluctuations have long-range correlations, the property that a run of long intervals now makes a run of long intervals more likely hundreds of beats later. The method:

  1. Subtract the mean from every interval and add the results up as you go, giving a running total y(k)y(k). A random series gives a random walk; a correlated one gives something smoother.
  2. Cut y(k)y(k) into boxes of nn beats. Fit a straight line in each box and subtract it; this is the detrending Detrending Removing the slow drift from a series of beat intervals before a spectrum is calculated, so the drift does not pile up as false power in the lowest frequencies. More about Detrending .
  3. Measure the root-mean-square of what is left, F(n)F(n).
  4. Repeat for many box sizes and plot log⁡F(n)\log F(n) against log⁡n\log n. The slope is α\alpha.
F(n)=1N∑k=1N[y(k)−yn(k)]2  ∝  nαF(n) = \sqrt{\frac{1}{N}\sum_{k=1}^{N}\bigl[y(k) - y_n(k)\bigr]^2} \;\propto\; n^{\alpha}

Read it as: how much the running total wanders away from its local trend, in boxes of nn beats, and how fast that wandering grows as the boxes grow. Peng’s team found the slope changes at about 16 beats, so two slopes are reported: α1 over short boxes and α2 over longer ones. The box ranges vary. This site’s library uses 4 to 16 and 16 to 64 beats, as do Quigley and colleagues (2024) and Rogers and colleagues (2021); Kubios HRV 3.5 defaults to 4 to 12 and 13 to 64 (Kubios HRV User’s Guide, 2021); and the ESC and EHRA position paper notes that many clinical studies took α1 over 4 to about 11 beats.

The benchmarks are exact. White noise, intervals independent of each other, gives α = 0.5. A random walk, each interval the last plus a random step, gives 1.5. Between them, at α = 1.0, lies 1/f noise, the scale-free pattern in which short and long fluctuations are balanced, and that is where a healthy resting heart usually sits (Peng and colleagues, 1995). In Peng’s data, severe heart failure broke this long-range pattern down.

The recording gives α1 = 0.49 and α2 = 0.65. That α1 is a confession. The teaching recording is three sine waves plus white noise; the sines repeat at fixed periods and the noise is independent beat to beat, so there is no fractal structure for DFA to find, and the short-range slope lands near the white-noise value. A real five-minute resting recording from a healthy adult usually gives α1 near 1. This is one more thing the nonlinear measures can see that SDNN cannot: the recording is synthetic, and α1 says so.

Lengths matter more here than anywhere else. α2 needs boxes of 64 beats and several of them, so Quigley and colleagues (2024) put the minimum for fractal measures at 20 minutes; this site’s calculator reports α2 only from 20 minutes and refuses it below 256 beats. α1 is cheaper: in the ultra-short study Shaffer and Ginsberg (2017) review, 2 minutes of beats gave an α1 that tracked the 5-minute value, and a 2-minute window is what makes the exercise application possible.

Does the rhythm remember?

Five minutes of the teaching recording

α1 (4–16 beats)
0.49
α2 (16–64 beats)
0.65

The rested recording is synthetic: a clean breathing wave every four beats with random noise between beats, so over 4 to 16 beats it looks almost like noise (α1 0.49), and the slower waves give 16 to 64 beats some memory (α2 0.65). Real recordings at rest usually give an α1 of about 1 or higher.

The controls work when JavaScript is on.

Detrended fluctuation analysis of five minutes of the teaching recording. Each dot is the typical wobble of the running sum inside boxes of a given number of beats; on log–log axes the dots fall on lines whose slopes are α1 (4 to 16 beats) and α2 (16 to 64 beats). White noise gives 0.5, 1/f noise gives 1. The teaching recording is synthetic and reads about 0.5; real recordings at rest usually give about 1 or higher. Switch the series, or mix noise into it, and watch the slopes.

A log–log chart of fluctuation against box size from 4 to 64 beats, with dots for each box size and two fitted lines: one over 4 to 16 beats for α1, one over 16 to 64 beats for α2. Readouts give α1 and α2, followed by a sentence explaining them. Four buttons choose the rested recording, white noise, 1/f noise or the recording with ectopic beats; a slider mixes white noise into the chosen series.

What they have added in practice

During exercise. As effort rises, the beat series loses its fractal order and α1 falls from about 1.0 towards 0.5 and below. Rogers and colleagues (2021) proposed α1 = 0.75, the midpoint, as a marker of the first ventilatory threshold, the top of easy aerobic effort. In 15 men on an incremental treadmill test, with α1 computed over a rolling 2-minute window after Kubios automatic correction (0 to 3% artifacts Artifact An error in a heartbeat recording, such as a missed, extra or mistimed beat, often caused by movement or poor sensor contact. Artifacts can badly distort HRV numbers. More about Artifact ), the heart rate at α1 = 0.75 matched the gas-exchange threshold with a mean difference of about 2 beats a minute and limits of agreement from −12 to +8 beats a minute. That is the basis of the “DFA α1” readouts in some training apps. The study is small, male and treadmill-based, and its authors say so; two of the 17 volunteers were excluded because frequent ectopic beats Ectopic beat A heartbeat that starts outside the heart's normal pacemaker and usually comes early. Ectopic beats are common, but they distort HRV unless removed or corrected. More about Ectopic beat made their α1 curves uninterpretable.

After a heart attack. The ESC and EHRA position paper (Sassi and colleagues, 2015) reviews cohorts in which a low α1, with cutoffs such as below 0.65 or 0.75, predicted death after myocardial infarction, and notes that α1 correlates strongly with the Poincaré ratio SD1/SD2 SD1 and SD2 Two measures of the spread of dots in a Poincaré plot, in milliseconds. SD1 is the width and tracks short-term variability, like RMSSD; SD2 is the length and tracks overall variability. More about SD1 and SD2 (r = −0.92 in one group of older adults). In heart failure its advantage over clinical prediction was, in their words, “at best modest”. For entropy the evidence was thinner: ApEn and SampEn fell during sympathetic Sympathetic nervous system The "fight or flight" branch of the autonomic nervous system. It speeds up the heart and makes it pump harder, but it acts too slowly to drive beat-to-beat HRV. More about Sympathetic nervous system activation on a tilt table, ApEn fell before episodes of atrial fibrillation, and SampEn predicted sepsis in premature infants.

The verdict. The position paper’s conclusion is that the new methods have improved the technical understanding of HRV but have had “rather limited” success as clinical tools, that they do not substitute for the traditional measures, and that traditional time- and frequency-domain analysis remains “the methods of choice” for assessing autonomic physiology. It recommends using them alongside the 1996 measures, not instead, and withholding them from clinical risk studies until prospective comparisons are done. Shaffer and Ginsberg (2017) add a caution from the other direction: higher nonlinear HRV has predicted mortality after infarction in some cohorts, so a higher value is not automatically healthier.

Reading a nonlinear number on a device

Ask three questions. Which measure, with which settings: mm, rr, the box sizes, detrended or not? How long was the recording: α2 and the entropies from a 1-minute reading are not meaningful, whatever the app shows. And how clean: one ectopic beat spoils a DFA fit far more than it spoils SDNN, which is why Rogers excluded participants with frequent ectopy rather than correcting it.

Lesson 20 turns from computing numbers to reading the studies and device tests that use them.

Try this

Open the HRV calculator with the sample recording and note SampEn and DFA α1. Then paste the same intervals in a different order (reverse the list, or sort it) and run it again. Write down which of RMSSD, SDNN, SampEn and α1 changed.

Check your understanding

Get 3 of 5 right (60%) to pass and tick off this lesson. You can try as often as you like; the options are shuffled each time and your best score is kept.

The questions below are readable without JavaScript. Checking your answers needs JavaScript.

Question 1 The step-by-step widget lets you retype the same ten intervals in a different order. Which of these changes when you do?
Question 2 What value of DFA α1 does a series of purely random, independent intervals give?
Question 3 How is sample entropy defined?
Question 4 According to the ESC and EHRA position paper, how should nonlinear measures be used in clinical work?
Question 5 During an incremental treadmill test, DFA α1 fell as the effort rose. At which value did one study place the first ventilatory threshold?

Course map

Sources

  1. Quantification of scaling exponents and crossover phenomena in nonstationary heartbeat time series Chaos, 1995
  2. Physiological time-series analysis using approximate entropy and sample entropy American Journal of Physiology, Heart and Circulatory Physiology, 2000
  3. Approximate entropy as a measure of system complexity Proceedings of the National Academy of Sciences of the United States of America, 1991
  4. Advances in heart rate variability signal analysis: joint position statement by the e-Cardiology ESC Working Group and the European Heart Rhythm Association co-endorsed by the Asia Pacific Heart Rhythm Society Europace, 2015
  5. An overview of heart rate variability metrics and norms Frontiers in Public Health, 2017
  6. A new detection method defining the aerobic threshold for endurance exercise and training prescription based on fractal correlation properties of heart rate variability Frontiers in Physiology, 2021
  7. Publication guidelines for human heart rate and heart rate variability studies in psychophysiology, Part 1: physiological underpinnings and foundations of measurement Psychophysiology, 2024
  8. Kubios HRV User's Guide, version 3.5 Kubios Oy, 2021