# Zones, Load and Agreement

Class 10, Chapter 5: Heart Rate, ECG and Heart Rate Variability. 30 slides, about 38 minutes.

## 1. Title

Slide up while people sit down. Last class we turned a heartbeat into a number. Today we ask two questions of that number: how hard was the session it describes, and how far can you trust it? Then you start building your own heart-rate page.

## 2. Maximal heart rate: a formula with wide error  (1.5 min)

Zones and load scores need a maximal heart rate, and the number everyone knows is two hundred twenty minus age. It has no single source study, and age-only equations miss individuals by seven to eleven beats as one standard error. So misses of twenty beats happen. A twenty-year-old's formula says two hundred; the truth could easily be one eighty or two twenty. A measured maximum is better: the highest value from a strap in a hard race or test you trust. The Heart app has a field for it. And to be clear, nobody here is asked to do a maximal test.

## 3. Zones, three ways  (1.5 min)

Coaches divide heart rate into zones so a session can be prescribed and checked. Three common ways. Percent of maximum, five zones, the way the Heart app does it. Heart-rate reserve, which is maximum minus resting: the target is rest plus a fraction of the reserve, so it adapts to a fit athlete with a low resting rate. And threshold-anchored zones, from two heart rates measured in a test, which are tied to the athlete's own physiology rather than a formula. In the example: rest fifty, maximum one ninety. Seventy percent of reserve is one forty-eight. Seventy percent of maximum is one thirty-three. The same words, fifteen beats apart.

## 4. How many hard minutes?  (2.5 min)

[Ask the room before you click.] One session, one strap, thirty-four minutes. A coach asks: how much of that was hard? Using zones four and five of the five-zone models, and zone three of the threshold model, will the three answers be close? [Take a guess or two, then click.] Nine point four minutes by percent of maximum. Ten point nine by reserve. Three point four above the second threshold. A factor of three, from the same heartbeats. The five-zone models lean on a formula maximum that could be ten beats off; the threshold model leans on the athlete's own test. Name the model in every prescription.

## 5. Training impulse, by hand  (2.5 min)

A load score turns a session into one number for how long and how hard. Banister's training impulse weights each minute by the fraction of reserve and by an exponential that stands for the steep rise of blood lactate. [Two minutes, by hand.] Thirty minutes at one fifty, rest fifty, maximum one ninety. [Click.] f is zero point seven one four, the exponential is three point nine four, and the training impulse is fifty-four. Now the app's choices: a workout file holds no true resting rate, so the app takes the session's fifth percentile and caps it at eighty. Change rest or maximum and the score changes.

## 6. What a load score can and cannot say  (1 min)

One minute on limits, because load scores look authoritative. A load score compares sessions for one athlete measured the same way. It cannot compare two athletes. It does not see strength work or running technique. It inherits whatever rest and maximum it was given, and heart rate itself drifts with heat and fatigue. Rules that turn load ratios into injury predictions have serious limits, and Chapter six shows why. So use a load score to describe training, not to forecast injury.

## 7. Four statistics for two devices  (2 min)

To judge a device you need a better one worn at the same time, a reference, the same moments from both, and statistics for the differences. Four of them. Bias, the average difference: does it read high or low? Mean absolute error: how far off is a typical reading, in beats? The same as a percentage. And limits of agreement: bias plus or minus one point nine six standard deviations, the range that holds about ninety-five percent of single readings. Notice what is missing. Correlation. A device that always reads ten beats high correlates perfectly and is wrong every time.

## 8. Five paired readings, by hand  (3 min)

[Three minutes, in pairs, calculators allowed.] An interval session, a strap and a wrist sensor at the same five moments. Compute all four. [Click.] The differences are minus two, minus ten, minus four, plus three, minus five. Bias minus three point six. Mean absolute error four point eight. Mean percentage error three percent. The standard deviation of the differences is four point seven two, so the limits run from minus twelve point nine to plus five point seven. The wrist reads a little low on average, but any single reading could be thirteen beats low. Listing five seven does the same in a few lines.

## 9. One strap, two of its own outputs  (2.5 min)

Here is a real Bland and Altman plot. Each dot is a five-second window of the workout example. Across the bottom, the average of two numbers; up the side, their difference. And both numbers come from the same strap: the heart rate it displays, and the rate from its own beat-to-beat intervals. Even these disagree by up to six beats in single windows, because the displayed rate is smoothed over several beats. The solid line is the bias, a quarter of a beat. The dashed lines are the limits. Lesson for your own validation: line up the clocks before you compare anything.

## 10. What do limits of agreement mean?  (2 min)

[Thirty seconds, hands up.] The answer is D. Limits of agreement are about single readings: about ninety-five out of a hundred differences fall between those two numbers. A confuses the limits with the bias, which is one number, minus three point six for these limits. B mixes in correlation, which limits do not measure. C reads only the upper limit and forgets that the lower one is almost thirteen beats. When you read a validation study, look for these limits, because they tell you how far off the next reading could be.

## 11. What the studies show  (1.5 min)

The published evidence, condensed from the book's table. Read each row with its study: who, against what, doing what. A strap is close to a clinical ECG across activities. Optical sensors are good at rest and in steady running, worse in cycling, worse again in rowing and strength work where the hands grip and the wrist flexes, and better on the upper arm. Skin tone is not settled; tattoos clearly hurt. You can run your own small validation in an hour. Report it honestly: one person, one activity, one reference, so nobody mistakes it for a general result.

## 12. The Heart app: open the resting example  (2 min)

[Everyone open the app now.] The Heart app runs entirely in your browser; analysis happens in a background worker, and nothing is uploaded. Load the resting example from its examples, choose recording type Rest, and check two things: RMSSD is twenty-two point five, and every ten-second segment is graded usable. Then open the ECG Explorer and find the R peaks we plotted last class. To record yourself, Live Capture needs a browser with Web Bluetooth. If yours does not have it, including any iPhone, use the phone logger and upload the file. For every output, ask: measured, derived or modeled?

## 13. The 2.4% trap  (2.5 min)

Your page this week reads the standard heart-rate message that every strap sends. Byte zero is a set of flags. Then the heart rate. Then, if bit four is set, RR intervals, two bytes each, and the unit is one ten-twenty-fourth of a second, not a millisecond. [Ask before you click.] An RR of eight nineteen. What does a program that thinks it is milliseconds show? [Click.] The true interval is seven ninety-nine point eight milliseconds, seventy-five beats a minute. Read as milliseconds, seventy-three point three, two point three percent low. Every number looks plausible. Only a test with a known answer catches it.

## 14. Listing 5.9: a test with known answers  (2 min)

Test the decoder before you trust it. Listing five nine builds three messages by hand. The first has flags hex ten, so an eight-bit rate with RR intervals present, a rate of hex four B, which is seventy-five, and one RR of eight nineteen ticks, the example we just did. The expected output is seventy-five and seven ninety-nine point eight. The second sets the sixteen-bit flag and carries two intervals. The third has an energy field the decoder must skip. If your page passes all three, the conversion is right. Run it with node; it takes a second.

## 15. Build Lab B-5: heart rate from a file, then live  (2.5 min)

This week's build step, in your Vite project from earlier weeks. Prompt your AI assistant for each part, then test it. First, a page that loads the resting RR file and draws heart rate on a canvas. Second, the three HRV measures, with the hand example as the known answer: thirty-two, fifteen point seven, zero. Third, a Connect button. The browser opens its Bluetooth chooser only after a tap, so the request goes inside the click handler. Fourth, your decoder passes the three tests. Last, run your page beside the Heart app on the same strap and compare intervals. You are graded on the tests, not the code style.

## 16. Check the AI: a page that reads 2.3% low  (2 min)

A scenario from this build. The assistant writes a decoder; you connect; the page works and looks right. But beside the Heart app it is always a little low. Seventy-three against seventy-five. Where do you look? [Take answers, then click.] At the line that converts RR ticks to milliseconds. The assistant used the raw value, so every interval is two point four percent long and every rate two point three percent low. The fix is one factor, a thousand over ten twenty-four. The point is the order: write the known-answer test first, and the assistant's mistake shows up before you ever put on a strap.

## 17. The instructor's nights, five minutes at a time  (2.5 min)

Back to the instructor's two nights. Each dot is the RMSSD of one five-minute window. Within one night most windows fall between about thirty-five and eighty milliseconds, rising and falling as sleep deepens and lightens. The nightly number is the median of all those windows: fifty point three, and fifty-eight point seven. Now the question for homework eleven. The two nights differ by about eight milliseconds. The windows within a night differ by forty or more. How sure can we be of the difference? You will answer that with a bootstrap that resamples whole windows, because neighboring beats are not independent. Training information only; no rhythm reading.

## 18. Two reports of the same morning  (3 min)

A runner has seven mornings of HRV and then an eighth after a hard weekend. Two reports. [Read the left one aloud.] It uses a number without a baseline or its noise, names a cause it cannot know, predicts a risk no study supports for one person, and gives an instruction far out of proportion. The better report gives the number, the athlete's own baseline, the size of normal day-to-day change, a plain reading, one modest recommendation, a retest date and the scope. The book's full version adds: if it is still low on the third morning, let's talk about the week. Five sentences carry all of it.

## 19. Before Class 11  (1.5 min)

Homework eleven is due at the start of next class. Use the instructor's strap recordings, the ones in the plot. Compute RMSSD by night in five-minute windows, the one-minute recovery after each repeat, and a bootstrap interval. The key choice is what you resample: whole windows or whole repeats, not single seconds, because neighboring seconds are not independent. Finish build step five and write the five-sentence note. Bring your page running. And read sections six one to six six before next class: GPS watches and motion sensors, and the question of how far a runner actually ran.
