Saturday, October 30, 2010

A calculator for predicting marathon time based on elevation profile

Chuck pointed me to Greg Maclin's site and it's excel calculator for predicting marathon times as a function of hills and turns. I've now wasted 1.5 days building my own calculator in R based on hills only. R is a statistical programming language and I cannot compile it to make a web applet. Sorry.

Background info: Basically, every 0.05 miles, I compute a "pace adjuster coefficient" based on the grade of the terrain for that 0.05 mile segment. The pace adjuster coefficient is just the % increase or decrease in the expected pace on a flat course due to a hill. The formula for adjustment are from Maclin's xls predictor. Hills affect us more late in the race so the pace adjustment percentage increases for climbs but decreases for descents after mile 16 and even more after mile 21. The difficulty of a marathon (based on hills, at least) can be summarized with a single factor, which I'll call the Marathon Difficulty Factor, which is just the average pace adjuster coefficient over all segments.

The problem with any such calculator is the estimation of the elevation profile. Here are the total ascents (in feet) of 5 marathons using 4 different websites:

544 295 897 1129
NA 427 955 1230
629 758 NA 1742
526 295 552 583
NA 659 1870 2252

MMR is mapmyrun, AAR is USATF's America's Running Routes, and RA is RunningAhead.

In general, the total ascent is ordered RA > USATF > Maclin > MMR but there are enough exceptions that no general rule can be created. More importantly, these differences have consequences on the calculated running time (and Marathon Difficulty Factor). Because I can manipulate the smoothing parameter of the spline that I fit to the elevation profile, my calculator can compute the expected time based on any of the above estimates. Cool huh?

So here is what I get for the Maine Marathon based on a 3:00:00 marathon on a flat course (MDF is the Marathon Difficulty Factor, which is the same for any goal time. Multiply the MDF to your flat-course pace and you've got your hilly-course pace!):

Ascent Time MDF
RA 1219 3:02:47 1.0154
ARR 955 3:02:10 1.0120
MMR 425 3:00:53 1.0050

So which am I to believe? At the bottom of this post, I've inserted an image of the three elevation profiles for the Maine Marathon based on the above three total ascents. Based on my knowledge of the course, the MMR profile is clearly too smoothed; it underestimates both the grade and peak elevation of the hills (that is, it flattens the hills out over a longer distance). The RA estimate looks to be not smoothed enough. And the USATF estimation looks about right.

Added at 6:16PM: MapMyRun ignores ascents less than 60 meters. Holy cow! Even the downloadable .csv files though seem to be oversmoothed relative to the other sites.

For my running bro' Jamie, here are the estimates for the MDI marathon

Ascent Time MDF
RA 2112 3:04:57 1.0275
ARR 1857 3:04:20 1.0241
MMR 660 3:01:34 1.0087

Two notes:
1. I always wondered how much hills mattered. Is MDI 1 minute or 5 minutes or 10 minutes slower than Maine for a 3Hr Maine marathoner? Based on my initial results, I'm pleasantly surprised to find that something like MDI probably adds only 2 minutes on top of Maine. However, just like Mt. Washington, when things go wrong on hills, they can go very wrong. That is, if a hill is run too fast (the actual pace isn't adjusted by effort), a slow death spiral will surely result. So a well-run hilly marathon should be within 2-5 minutes of a well-run flat marathon but a poorly-run hilly marathon will be many, many minutes slower than a well-run flat marathon.

2. For the purpose of comparing MDF among marathons, what we really need is course elevation profiles collected and smoothed in the same way. Maybe all MMR or RA or USATF.

The RunningAhead elevation profile of the Maine Marathon. A little undersmoothed?

The USATF America's Running Routes profile of the Maine Marathon. About right?

The MapMyRun elevation profile of the Maine Marathon. Definitely over smoothed.


  1. Two minutes for MDI... At first, I was a bit surprised it was that small. But after thinking about it a bit, I guess it makes sense to me. The slower that marathon times get, the time gap will likely get wider. For me, probably in the 3-5 minute range. I can't see myself running the Maine Marathon any faster than that.

  2. Jamie: Yeh - among other things (fitness, temperature, aligned planets), the time difference assumes similar races in both, so if I were to go out conservatively, or take the hills conservatively at MDI, that would add additional time. But it's a useful tool to figure out a pacing strategy for different marathons (or any race really).