Friday, October 17, 2014

heuristic error check for rider mass (kg) vs age

For Low-Key Hillclimbs I have a mass-adjusted climbing score, which is based on the product of the rider mass and the rate of vertical ascent. This isn't a power calculation, but is related to power, and the units differ from power only by a factor of the gravitiational acceleration, which is roughly constant.

The natural units of mass for international sports is kilograms, but this is the United States, and people here are more accustomed to dealing in pound-equivalents (pounds formally being a unit of force or weight, not mass). So rather than require riders to calculate their mass in kg, which they may be less likely to recall than their weight in pounds, I default to having them enter pounds, with an optional unit specification which can allow for other units (I presently support pounds, kilograms, stone for my Britophiles, and slugs to be pedantic).

But people mess up. One friend specified his mass as "10 stone 8 pounds", a mixed unit I can't handle (my parser considered that as "10 pounds"). But more often people will enter kg without a unit. That seems to happen once or twice per week.

So what to do? The pragmatic approach is to check the weight, and it's low (pounds and kg differ by a factor 0.454), then assume it is kg. But what about young riders? Sometimes people bring kids on the Low-Key in trailers. So I need a threshold for what I consider "too light for pounds" which is a function of age, yet which isn't so low that relatively heavier riders if they make the mistake won't get caught.

Of course, if I had height, that would help. But I don't. So I need to go with age.

To accomplish this, I developed an ad hoc age-to-mass conversion. First I needed to come up with a threshold for infinite age. 40 kg seems reasonable: 88 pounds. There's women lighter than this, but it's the infinite-age limit, and for finite age, my threshold would be reduced lower. Note I could use sex as well, except for tandem riders sex can be "mixed" due to the way I process results, so I decided to not use that.

On the other hand, if a rider were to enter 90 kg, a reasonable mass, then my code would still consider that to be a reading in pounds So there's a chance of bigger riders making the mistake and slipping through. Fortunately this is a hillclimb series, which tends to attract relatively thin people, so the substantial majority are under 90 kg.

Then I need to adjust the mass versus age. Once people reach adulthood, mass maxes out, so my function needs to asymptote beyond age 21 or so. The very young tend to grow at a certain rate, but since mass increases superlinearly with height (BMI suggests to the second-power, but it's more realistically a higher power, closer to 2.5). So in the early years the mass increases proportional to age to some power greater than 1. That power won't necessarily be constant with age, but I'll assume that's a good approximation.

So here's the equation I came up with:

kgmin = (40 kg) (age / 15 years)2 / sqrt [ 1 + (age / 15 years)4 ]

I picked 15 years because this seemed like an age at which growth stops increasing as rapidly as it does at younger ages.

The behavior of this equation is clear. For small ages, the denominator is essentially 1, and the mass increases proportional to the square of age. But at high ages, the 1 in the denominator becomes irrelevant, and the numerator and denominator cancel, leaving an asymptote of 40 kg.

I decided to check this against published data for mass versus age. Here's data for boys age 0 to 17:

And here's data from girls:

I used the 5%-tile data because I'm interested in a lower-bound limit, and in any case 50% and above are confounded by the obesity epidemic which tends to not afflict children of Low-Key hillclimbers.

Here's a comparison of my equation with these data:


My curve is conservative, tracking women better than men, the girls' mass tracking the boys' until an age where they saturate while the boys keep going.

No comments: