Depending on the activity, you can estimate it pretty well based on e.g. a person’s weight. For instance, the amount of calories you burn running a mile depends mainly on your weight. It also depends a bit on your speed, but not much. Of course, other factors do play a role, like how efficient your movements are (e.g. if you have a lot of vertical motion, bobbing up and down, that “wastes” more energy), as well as different physiological and anatomical factors. But those other factors are more marginal. Based on weight alone, you can get a fairly good estimate. That is, as long as you’re running on flat terrain with not too much wind. If there’s lots of climbs on your route, that can make a substantial difference that you need to account for, which is possible (in principle) using GPS. Wind of course is much harder to factor in.
This is just one example. Not every activity is so easy to estimate. Cycling is easy. Anything you do on a machine (like a treadmill, elliptical, rowing machine, etc.) is especially easy as the machine knows more of the variables (like the exact resistance on your stationary bike). But something like boxing, or playing basketball, that’s much harder as there’s a wider array of different movements involved. You can still do studies to get average estimates, but they won’t be as accurate if you apply them to different individuals.
Latest Answers