How Pensum measures your energy expenditure
The full algorithm: the method, every constant, and the tests it has to pass.
Many trackers give you a maintenance calorie number from a formula and never revisit it. The formula reads your height, weight, age and sex, multiplies by an activity guess, and returns one figure with a couple of hundred calories of error either way. Pensum starts from the same formula, because on day one there's nothing else to go on. After that it measures the number from your own weight trend and food diary, re-takes the measurement every day, and moves your calorie target with it.
In short
- Expenditure is what you ate minus what your weight trend says you stored, re-measured every day over the last two weeks.
- Each kilogram the trend moves counts as 5,500 kcal, since not every kilogram is fat.
- The shown number weighs roughly the last six weeks. Water swings barely move it, and a real change takes six to nine weeks to show halfway.
- Period water you log is taken out of the weight trend before anything else runs.
- It's tested in 14 simulated worlds where the true answer is known, and on a real MacroFactor user's year, where the two apps' numbers were 15 kcal a day apart on average.
The one equation everything rests on
Energy that goes in and doesn't leave as work or heat is stored, mostly as fat, some as glycogen and the water that comes with it. Run that backwards and expenditure becomes something you can read off two signals you already record:
expenditure = mean daily intake − (change in stored energy) / days
The stored-energy term comes from body weight. The textbook figure for a kilogram of body-weight change is about 7,700 kcal, which Wishnofsky derived in 1958 from the fat content of adipose tissue.1 I use 5,500 kcal per kilogram instead, for the reasons in the next paragraph. So if you averaged 2,500 kcal a day for two weeks and your weight trend fell by half a kilogram over that stretch, Pensum counts about 2,750 kcal taken out of storage, near 196 a day, and an expenditure close to 2,700.
The 7,700 figure has two problems. Used as a long-range predictor ("cut 500 a day and you'll lose a pound a week forever"), it overstates loss badly, because expenditure falls as you get lighter and the mix of what you lose shifts.2 Pensum only converts the slope you already observed into energy, re-taken every day. The second problem matters more for a measurement. Not every kilogram the trend moves is fat. Some is lean tissue, which holds far less energy, and some is glycogen with its bound water, which holds almost none. A 75/25 split of fat and lean alone brings a kilogram down to roughly 6,000 to 6,500 kcal, and short-term water pulls the effective figure lower still. Reading every trend kilogram at the fat figure makes the estimate overreact to water. On a real year of MacroFactor data (see below), MacroFactor's expenditure behaved as if it credited 5,250 to 5,750 kcal per kilogram, and 5,500 matched it best. Plans and calorie targets still convert a weekly rate at 7,700 kcal per kilogram.
Reading energy balance backwards from weight change is an established method. Sanghvi and colleagues validated it against doubly labelled water, the gold standard for measuring free-living energy use, and found it recovers long-term intake changes accurately.6 Pensum adds the day-to-day machinery that makes the number stable enough to set a calorie target from.
Why a single weigh-in means little
Step on the scale two mornings running and it can move a kilogram with no change in fat at all. Most of that is water. Glycogen binds roughly three to four grams of water per gram stored, so a weekend of higher carbs can put one to three kilograms on the scale that leave again a few days later.3 A raw daily weight makes the computed expenditure jump around uselessly.
So the estimator works from a trend: an exponentially weighted moving average that moves 10% of the way toward each new weigh-in, the smoothing the Hacker's Diet made popular. Its half-life is about a week, long enough to ignore a salty dinner and short enough to follow a real trend within days. Gaps between weigh-ins are filled by straight-line interpolation before smoothing, so a missed day doesn't distort the trend.
The slope of that trend line becomes the change-in-storage term.
Where the estimate starts
Until there's enough of your own data to measure anything, the estimator shows a seed: a modern regression-based BMR equation from your body metrics, multiplied by an activity factor. It's the standard formula most trackers use, and on its own it's a guess with a couple of hundred calories of spread. The TDEE calculator runs the same kind of equation in your browser if you want to see what it gives for you.
The seed gets two corrections. A sustained calorie deficit pushes expenditure below what your reduced body mass alone would predict: Leibel, Rosenbaum and Hirsch measured it running about 15% under prediction at a maintained 10% weight loss.4 How big that effect really is remains disputed, and some researchers find it smaller under tight measurement, so I apply a conservative fraction. Pensum trims 5% off the seed while you're cutting, and a further 3% once you're more than 10% below your heaviest logged weight, where the effect deepens. The second correction removes a known cold-start bias tied to your chosen rate of loss or gain. Both only shape the starting point, and after a few weeks the seed no longer affects the number.
Turning noisy days into one moving number
Each day, the estimator takes the trailing two weeks. The observed expenditure for that window is the mean of the tracked days' calories minus the trend slope converted to energy:
observed = mean intake − (trend slope, kg/day) × 5500
That daily observation is still noisy, so it feeds a second moving average that puts 3% weight on each new observation. It forgets half of what it held in about 23 days, so the data behind the shown number is on average five to six weeks old, and the number moves a few kcal a day. The smoothed value is the expenditure the app displays and, if you opt in, the number your calorie targets follow. The number is slow as a result. When your expenditure really changes, for example a new job on your feet, the estimate takes six to nine weeks to show half of the change (see the activity step below). Three limits apply on top of that:
- A daily step clamp. The shown number can move at most 100 kcal from one day to the next, so one odd reading can't swing your target. With the slow average this only matters with broken data and during the first month.
- A band around the seed. The estimate stays within 40% of the formula seed. A measurement outside that band means the input data is broken.
- A partial-day screen. A tracked day whose calories fall below half the window's median looks like a day you logged breakfast and forgot dinner. It's dropped from the mean so it can't fake a huge deficit.
Missing days inside the window are filled with the median of the same weekday's recent intake, because skipped days tend not to be typical ones. For the first month the average runs faster: its weight starts at 35% and the step clamp at 200 kcal, both easing to their steady values by day 30, so a wrong seed gets corrected quickly. And every time the number is recomputed, Pensum replays up to a year of your diary, so the slow average starts from your own history.
Three situations that break a naive version
Each of these feeds the equation a false signal.
1. Switching between cutting and bulking
The day you end a cut and start eating in a surplus, your muscles refill glycogen and pull water in with it, one to three kilograms over a few days.3 Read through the equation, that water gain looks like a sudden store of energy, which drives a naive expenditure sharply down exactly when your real expenditure is steady or rising.
For 28 days after a change in direction, Pensum trusts each daily observation at a fifth of its usual weight, so the water signal barely moves the estimate. At the same time a predictive adjustment nudges the estimate the way physiology moves when you switch diet phase. I chose 28 days because the trend average itself takes about three weeks to absorb a step in water weight, so with a shorter window the end of the water shift would still reach the estimate. With the slow steady average the water hardly moves the estimate even without damping, as the chart shows. The damping still matters in the first month, while the average runs fast.
2. Missing and under-logged data
If you log four days out of seven, the estimator fills the gaps and carries on. If you log almost nothing for a stretch, it pauses and holds the last value instead of inventing one from three data points. With less than a full week of data at the very start, it shows the seed untouched, because that little data can't support a number.
3. Period water
Around a period the scale typically rises by about half a kilogram of water, highest on the first day of bleeding and gone within the following week. To the equation that looks like stored energy followed by a loss, so a naive estimate dips and recovers every cycle. If you log your period in Pensum, the expected water for each day is subtracted from that day's weigh-in before the trend is computed. The expected bump starts at 0.75% of your body weight, and once two logged periods have weigh-ins around them, Pensum learns your own pattern and leans on it more with every cycle. The slow average already flattens most of the ripple; the correction takes what's left down to 3 to 5 kcal. How the cycle is modelled, and the research behind it, is on the period tracking page.
The under-reporting problem
Self-reported food intake is inaccurate, and the error runs one way. People under-report what they eat by around 20% on average in validation studies against doubly labelled water, by far more in some groups, and individual gaps of 50% aren't unusual.5 If your diary under-reads by 15%, the expenditure Pensum measures reads low by about the same 15%.
The measurement is still useful, because your calorie target is computed in the same under-logged units. If you consistently log 15% light, your measured expenditure comes out 15% low, and so does the target built from it. The deficit between them, which is what drives weight change, lands where it should. The absolute number is biased, but the deficit stays right as long as your logging habits stay the same. It breaks if your accuracy changes partway through, say you get stricter about weighing food. Then the measured expenditure shifts for a reason that has nothing to do with your metabolism, and it takes a couple of months to settle again. Moving from photo estimates to a kitchen scale is one such change, since gram estimates from a single photo were off by 20 to 30% on average in my tests.
Checked against a real year of MacroFactor data
In October 2026 a MacroFactor user sent me their export: a weigh-in every day and food logged on nearly every day, through a cut, maintenance and a lean bulk. MacroFactor's export includes the expenditure the app showed each day, so I could feed the same weigh-ins and calories into Pensum and compare the two numbers directly.
From January to October 2026 the two numbers were 15 kcal a day apart on average, and never more than 63. The two constants that set the slow average (0.03) and the energy density (5,500 kcal/kg) were fitted on January to June. July to October played no part in the fit, and there the gap was 7 kcal a day. The trend smoothing, the 14-day window, the step clamp and the damping window stayed as they were, and I reran the simulated worlds below to confirm the fit didn't break any of them. It's one person's data, so I keep checking as more exports come in. The full comparison is in MacroFactor's expenditure number, free in Pensum.
How I test it
Agreement between two apps says nothing about whether either is right, because measuring someone's true expenditure takes doubly labelled water in a lab. No app in this category, Pensum included, has that.
In a simulation the true answer is known. I build worlds where I set the true daily expenditure and the true tissue weight myself, move the body forward by the same energy-balance law, and let the estimator see only what the app would see: a diary, and a scale reading that carries the true tissue plus a realistic water and glycogen overlay plus daily weigh-in noise. That makes the error exact. Each world is seeded, so runs are reproducible, and the numbers below are regenerated on each change and guarded by a test.
The worlds are built forward at 7,700 kcal/kg, while the estimator reads weight change back at 5,500. I kept them at 7,700 so the numbers stay comparable with earlier versions of this page. The cost shows in any world with a sustained weight trend (the steady cut, the activity step, the cut-to-bulk flip, the coin-flip diary): the estimator credits about 29% less energy to that trend than the world spent, and the shortfall counts as truth error. A simulation built at 7,700 can't pick the density, which is why it comes from the export above. The worlds test everything layered on top of the density, meaning scale noise, missing days, water artifacts and real shifts in expenditure, which is where a naive version breaks. The worlds model energy-balance physics and the main sources of scale noise, nothing more.
Each world gets two scores. Truth error is how far the estimate sits from the true expenditure, in kcal, the number only a simulation can give. Stability is how much the shown number moves day to day; lower means steadier. There are 14 worlds. Seven of them, the plateau-then-whoosh, the creatine load and all five period worlds, are held out: no constant is ever tuned on them, so they show whether the tuning just memorised the cases it was allowed to see.
| Scenario | Held out | What it stresses |
|---|---|---|
| Maintenance noise | - | Flat intake and expenditure; the scale is pure daily water noise. Tests whether the estimate stays still when nothing is happening. |
| Steady cut | - | A real deficit with slow metabolic adaptation underneath. Tests tracking a genuine, gradual change. |
| Activity step | - | Expenditure jumps 300 kcal overnight. Measures how many days it takes to show. |
| Cut-to-bulk flip | - | A diet-phase switch with a glycogen-water gain. The estimate must not dip on the water. |
| Plateau then whoosh | yes | Water masks three weeks of fat loss, then releases at once. |
| Creatine | yes | A one-off water gain with no change in expenditure. The estimate should ignore it. |
| Coin-flip missing days | - | Half the diary deleted at random, ten times over. Tests robustness to gaps. |
| Weekly partial day | - | Every seventh day logged at a third of its real intake. Exercises the partial-day screen. |
| Cold-start bad seed | - | The starting formula is wrong by 15% each way. Measures how fast the error is worked off. |
| Period water (5 worlds) | yes | A logged period with a water bump of 0.5 or 1 kg, irregular cycle lengths, and bodies of 52 and 110 kg. The estimate should stay flat through every cycle. |
The results
Steady-state figures, meaning after the first 30 days of calibration. Truth error is the average distance from the true expenditure; stability is the average day-to-day movement. Lower is better in both columns.
| Scenario | Truth error (kcal) | Stability (kcal/day) |
|---|---|---|
| Maintenance noise | 16 | 2 |
| Steady cut | 48 | 1 |
| Activity step | 139 | 2 |
| Cut-to-bulk flip | 113 | 3 |
| Plateau then whoosh (held out) | 219 | 4 |
| Creatine (held out) | 57 | 2 |
| Coin-flip missing days | 195 | 1 |
| Weekly partial day | 11 | 1 |
| Cold-start bad seed | 3 | 1 |
| Period water, 5 worlds (held out) | 10-25 | 1-2 |
No world moves more than 4 kcal a day once calibration is over. The cut-to-bulk flip doesn't dip on the water at all (a naive estimator dips around 170); its 113 kcal of error is the 7,700-versus-5,500 shortfall on the cut and the bulk. The calm costs speed in the activity step. The estimate takes about 62 days to show half of an overnight 300-kcal step, and in this 7,700 world it levels off near 71% of it. The coin-flip diary carries the same density shortfall, and losing half the diary at random moves the final number by up to 68 kcal across ten tries. The cold-start world ends near 3 kcal despite starting 15% wrong, because the faster first-month average corrects the seed. In the period worlds the correction cuts the cycle's ripple in the estimate from 4 to 15 kcal down to 3 to 5.
The one Pensum handles worst: plateau then whoosh, at 219 kcal of steady-state error. When water masks three weeks of genuine fat loss and then releases all at once, the trend line misreads tissue for most of the window, and the estimate drifts high until the whoosh corrects it.
The creatine world is the other held-out case, at 57 kcal. A creatine load puts roughly 1.2 kg of water on the body over about ten days and never gives it back. The estimator reads that gain as stored energy and trims expenditure while it lands. Nothing reverses, so the drift clears only as the trend flattens over the following weeks, and that drift is what the 57 counts.
Check it on your own data
Pensum imports your history from MyFitnessPal, Cronometer, MacroFactor, Lifesum, FatSecret, YAZIO, FDDB and OpenNutriTracker. If you already have months of weigh-ins and diary days in one of them, export and import, and the estimator runs on your real history right away. At your logged intake, the measured expenditure implies your weight trend should move by a certain amount over the coming weeks, so check the trend against it after a month.
Pensum is a fast, private macro tracker with a measured expenditure engine built on the method above. The adaptive TDEE is free, with no ads and no account. Get Pensum on Google Play or the App Store, see Pensum next to MacroFactor, or go back to the homepage.
References
- Wishnofsky M. Caloric equivalents of gained or lost weight. American Journal of Clinical Nutrition, 1958;6(5):542-546. doi:10.1093/ajcn/6.5.542. Origin of the ~7,700 kcal/kg (3,500 kcal/lb) convention, derived from the fat content of adipose tissue, not a controlled trial.
- Hall KD, Chow CC. Why is the 3500 kcal per pound weight loss rule wrong? International Journal of Obesity, 2013;37(12):1614. doi:10.1038/ijo.2013.112. And Hall KD et al. Quantification of the effect of energy imbalance on bodyweight. The Lancet, 2011;378(9793):826-837. doi:10.1016/S0140-6736(11)60812-X. Both show the fixed rule overstates long-term loss because expenditure falls as body mass falls.
- Olsson KE, Saltin B. Variation in total body water with muscle glycogen changes in man. Acta Physiologica Scandinavica, 1970;80(1):11-18. doi:10.1111/j.1748-1716.1970.tb04764.x. Measures roughly 3-4 g of water stored per gram of glycogen, the basis for the rapid water-weight swings on carbohydrate refeeding.
- Leibel RL, Rosenbaum M, Hirsch J. Changes in energy expenditure resulting from altered body weight. New England Journal of Medicine, 1995;332(10):621-628. doi:10.1056/NEJM199503093321001. Maintained 10% weight loss lowered expenditure roughly 15% below what body-mass change alone predicts. See also Rosenbaum M, Leibel RL. Adaptive thermogenesis in humans. International Journal of Obesity, 2010;34(S1):S47-S55.
- Schoeller DA. Limitations in the assessment of dietary energy intake by self-report. Metabolism, 1995;44(2 Suppl 2):18-22. And Lichtman SW et al. Discrepancy between self-reported and actual caloric intake and exercise in obese subjects. New England Journal of Medicine, 1992;327(27):1893-1898. doi:10.1056/NEJM199212313272701. Self-report underestimates intake, on average around 20% and considerably more in some individuals and groups (the Lichtman figure comes from a small diet-resistant clinical sample, not the general population).
- Sanghvi A, Redman LM, Martin CK, Ravussin E, Hall KD. Validation of an inexpensive and accurate mathematical method to measure long-term changes in free-living energy intake. American Journal of Clinical Nutrition, 2015;102(2):353-358. doi:10.3945/ajcn.115.111070. Validates recovering energy intake and expenditure from serial body-weight change against doubly-labelled water.