Smart Calorie Burn v2

Many people ask, "How is MacroCodex, a completely free (subscription-free, ad-free) app, able to provide guaranteed weight loss or weight gain within 2-5 weeks when many coaches or dieticians fail to do so?". The answer is Smart Calorie Burn v2, the algorithm at the heart of MacroCodex. It is responsive, stable, accurate, and resilient to missing data, while accounting for temporary water weight fluctuations caused by hormonal changes, creatine use, sodium levels, carb induced glycogen swings, the menstrual cycle, stress hormones, and fluid retention.
Background and Physiological Foundations
Problem
It all started from a simple question
How much must a person eat to lose or gain X kg or Y lb of bodyweight?
Simple idea
If you ask a random layman on the street, "How do I lose or gain weight?", they'll tell you to eat less to lose weight and eat more to gain weight; the only thing that is left is to define what is "more" and what is "less".
The amount of energy the body burns in 24 hours is called Total Daily Energy Expenditure (TDEE).
The amount of calories consumed from food can be measured. Let's call this Daily Energy Intake (DEI).
If a person consistently eats more calories than they expend, some of that excess energy is stored in the body, primarily as fat and other tissue, resulting in bodyweight gain.
If a person consistently eats fewer calories than they expend, stored body energy must be used, resulting in bodyweight loss.
Surplus and Deficit
Define the daily energy balance as:
This signed quantity gives both the direction and magnitude of the imbalance:
Over a period of days, the cumulative energy imbalance is:
If the cumulative balance is positive, the body must, on average, store energy; if it is negative, it must, on average, release stored energy. Thus:
The expected magnitude of tissue-weight change is approximately related to the magnitude of the cumulative imbalance:
where is bodyweight change (positive for gain and negative for loss), is cumulative energy imbalance, and is the effective energy density of the weight change. Therefore, a larger sustained surplus tends to produce faster gain, and a larger sustained deficit tends to produce faster loss.
This is an approximation, not a fixed calorie-to-weight conversion: changes with the mix of fat, lean tissue, glycogen, and water, and short-term scale weight can move independently of tissue energy balance.
From Energy Balance to a Calorie Target
If we knew both:
- Daily calorie intake, and
- Total Daily Energy Expenditure
then answering:
"How many calories should this person eat?"
would become relatively straightforward.
For example, suppose someone wants to lose 1 lb per week.
If we knew the amount of energy corresponding to 1 lb of weight loss, we could calculate the required average daily deficit:
Then:
Similarly, for weight gain:
Bodyweight can be measured.
Daily calorie intake can be estimated using calorie trackers.
Therefore, the major unknown is:
But there is another unknown hidden inside the problem:
How much energy corresponds to a given amount of bodyweight gain or loss?
If we know this relationship, changes in bodyweight combined with measured calorie intake can also tell us something about the person's TDEE.
Conceptually:
Rearranging:
and therefore, approximately:
where the bars denote daily averages over the observation interval, is the interval length in days, is total weight change over that interval, and is the effective energy density in kcal/kg. Weight gain is positive and weight loss is negative. This time term is essential: is a cumulative energy change in kcal, whereas TDEE and average calorie intake are rates in kcal/day.
This gives us the basic idea behind estimating energy expenditure from observed calorie intake and bodyweight change.
But first, we need to understand the energy density of bodyweight change.
Subproblem 1: Energy Required for Weight Change
How much calorie surplus or deficit is required to lose or gain 1 kg or 1 lb of bodyweight?
Max Wishnofsky — 1958
The famous "1 lb = 3,500 kcal" rule traces primarily to physician Max Wishnofsky, especially his 1958 paper Caloric Equivalents of Gained or Lost Weight in the American Journal of Clinical Nutrition.
The reasoning was based largely on the energy density of human adipose tissue.
Wishnofsky's derivation treated pure triglyceride as containing approximately:
But human adipose tissue is not 100% triglyceride. It also contains water, protein, connective tissue, and other components.
Wishnofsky used earlier chemical-analysis evidence suggesting adipose tissue was approximately 87% fat. These are historical model assumptions, not universal measurements of every person's adipose tissue (Thomas et al., 2014).
Therefore:
Using approximately 9.5 kcal/g:
After reviewing weight-loss studies and making assumptions about the composition of lost tissue, Wishnofsky arrived at the practical approximation:
Since:
then:
This became the familiar:
rule.
Limitations of Wishnofsky’s Rule
Wishnofsky's number was not originally meant to imply that every pound appearing or disappearing on the scale always corresponds to exactly 3,500 kcal.
It can work reasonably well as an approximation of the energy content of predominantly fat-tissue loss under certain conditions.
The problem occurs when it is turned into a fixed linear prediction such as:
therefore:
Human bodyweight does not behave this way.
Weight lost can consist of varying amounts of:
- fat mass,
- fat-free mass,
- glycogen,
- associated water,
- and other body components.
Additionally, energy expenditure changes as bodyweight changes.
Therefore, the relationship between cumulative calorie deficit and bodyweight change is not perfectly constant.
Forbes — 1970s–1980s
Gilbert Forbes made a major advance by studying how changes in bodyweight are partitioned between (Forbes, 1987):
- Fat Mass (FM)
- Fat-Free Mass (FFM)
The important realization was that the fraction of lost weight coming from fat-free mass is not constant.
It depends strongly on the person's existing body composition.
In simplified terms:
while:
This matters because fat mass and fat-free mass have very different energy densities.
A useful approximation used in Hall's adult bodyweight model is:
while:
These are rounded forms of for fat and for modeled lean-tissue change, respectively (Hall et al., 2011, web appendix). The lean-tissue value should not be applied to arbitrary short-term changes in scale weight or conventionally measured FFM, because those can include water and glycogen shifts.
Therefore, one kilogram of bodyweight loss does not have a universal energy value.
If the fraction of lost weight coming from fat mass is , then approximately:
where:
Forbes' work primarily predicts this partitioning from the person's adiposity/body composition.
This means:
Limitations of the Forbes Model
The Forbes relationship provides an important physiological improvement over assuming that every kilogram of bodyweight change has the same energy density.
However, it does not mean that body fat alone completely determines how much fat mass and fat-free mass a person will lose.
Forbes' relationship primarily describes the expected relationship between existing body fat and the partitioning of subsequent bodyweight change.
In real-world weight loss, this partition can also be affected by the conditions under which the weight is lost.
Two people with similar body composition and the same amount of weight loss may not necessarily lose the same proportions of fat mass and fat-free mass.
Protein Intake
Dietary protein influences the preservation of lean tissue during an energy deficit.
Higher protein intake during calorie restriction has been shown to reduce the loss of lean body mass compared with lower protein intake under some conditions, particularly when combined with intensive exercise. For example, a randomized trial compared 2.4 with 1.2 g protein/kg/day during a marked deficit and intensive training (Longland et al., 2016).
Therefore:
can generally shift weight loss toward:
relative to:
for the same amount of total bodyweight lost.
This becomes particularly important in leaner individuals, where Forbes already predicts a greater risk of losing fat-free mass.
Resistance Training
Resistance training provides another strong signal for retaining skeletal muscle during an energy deficit.
A person who continues progressive resistance training during weight loss can preserve more lean mass than an otherwise similar person losing the same amount of weight without resistance training. One randomized trial comparing diet alone with diet plus resistance exercise found preservation of lean bodyweight in the resistance-training group (Bryner et al., 1999).
Therefore:
and consequently:
under many dieting conditions.
Protein intake and resistance training can also interact.
Adequate protein provides the substrate required for maintaining muscle protein, while resistance exercise provides a strong stimulus for maintaining or increasing muscle tissue.
Why This Matters for Energy Density
This does not merely affect body composition.
It also changes the energy density of the observed weight loss.
Recall:
Consider two people who each lose 1 kg.
If Person A loses:
then:
But if Person B loses:
then:
Both people lost exactly:
but the underlying energy deficits associated with that loss could be substantially different.
Therefore, if Smart Calorie Burn estimates average TDEE over an interval from:
then an incorrect estimate of FM/FFM partition directly creates an error in estimated TDEE.
Extending Forbes for Our Use Case
Forbes gives us an important baseline:
But for an adaptive calorie algorithm, a more realistic conceptual model would be:
The exact contribution of each variable is difficult to estimate perfectly for an individual.
The purpose therefore should not necessarily be to build a perfect physiological body-composition model.
Instead, Forbes can provide a baseline prior for expected FM/FFM partition, which can then be adjusted when relevant information is available.
For example:
This adjusted energy-density estimate can then be used by the adaptive TDEE algorithm.
The important lesson is therefore:
Body composition matters, but the conditions under which weight is lost also influence the composition of that weight loss.
Kevin Hall — 2000s
Researchers including Kevin Hall extended this idea into mathematical energy-balance models (Hall, 2008).
Hall's 2008 work explicitly asked:
What is the required energy deficit per unit of weight loss?
Instead of assuming:
for everyone, the energy deficit associated with weight loss can be related to the changing proportions of fat mass and fat-free mass:
Since and can change as the person loses weight, the effective energy density of bodyweight loss can also change over time.
So the first major lesson from the development after Wishnofsky is:
Hall and Chow — 2008–2011
Hall, Chow, and colleagues then developed mathematical models in which:
- calorie intake,
- energy expenditure,
- fat mass,
- fat-free mass,
- and bodyweight
interact continuously over time.
This showed that bodyweight change should be treated as a dynamic system, rather than repeatedly applying the 3,500 kcal rule.
The landmark practical treatment was Hall et al.'s 2011 paper:
Quantification of the Effect of Energy Imbalance on Bodyweight.
The important idea was that the person's energy deficit does not remain constant simply because their calorie intake remains constant.
For example, suppose:
and calorie intake is:
Initially:
But after losing weight, the person is smaller.
A smaller body generally requires less energy both at rest and during movement.
Their TDEE might eventually become:
while intake remains:
The actual deficit has therefore fallen to:
Later it may fall further.
So:
Lessons From Previous Work
By the 2010s, researchers such as Thomas, Hall, Chow and others had demonstrated clearly why the conventional 3,500 kcal rule substantially overpredicts long-term weight loss when used as a linear forecasting model.
The important distinction is that:
is not completely meaningless.
The problem is assuming that:
- every unit of bodyweight always has the same energy density, and
- the person's energy expenditure remains unchanged throughout the intervention.
From the work up to this point, we can establish two major principles.
Principle 1: Energy Density of Weight Change Differs
One kilogram of bodyweight loss is not one kilogram of pure fat.
Weight change can contain varying proportions of:
and:
and these tissues have very different energy densities.
Therefore:
The Forbes relationship provides an important physiological foundation for modeling this.
Principle 2: Energy Expenditure Changes as Bodyweight Changes
Some reduction in expenditure occurs simply because the person has become smaller.
Suppose:
After losing 10 kg, their new body composition might predict:
This reduction is not necessarily metabolic adaptation.
The person now has:
- less tissue to maintain,
- less body mass to move,
- potentially different thermic costs,
- and different energy requirements.
Therefore, some reduction in TDEE is an expected consequence of weight loss.
But this is not the entire story.
Leibel, Rosenbaum and Hirsch — 1995
Rudolph Leibel, Michael Rosenbaum and Jules Hirsch demonstrated an additional phenomenon.
After substantial weight loss, measured energy expenditure can fall below what would be expected simply from the person's new body size and composition.
For example:
After weight loss, the person's new body composition might predict:
But their measured expenditure might instead be:
The additional difference:
represents approximately:
This phenomenon is commonly referred to as:
adaptive thermogenesis or metabolic adaptation.
Therefore:
The body can also alter energy expenditure in response to changes in energy stores and bodyweight.
This is an important distinction:
is not the same as:
Adaptive thermogenesis refers to expenditure changing beyond what would normally be predicted from the person's altered body composition.
Subproblem 2: Is TDEE Fixed or Predictable?
Can TDEE itself be treated as a fixed or easily predictable quantity?
At first, we might estimate TDEE from:
or conceptually:
But the previous research suggests that the components of TDEE are themselves dynamic.
Bodyweight loss changes resting and movement costs.
Leibel and Rosenbaum demonstrated metabolic adaptation beyond these predicted changes (Leibel, Rosenbaum and Hirsch, 1995).
Other research has also shown that spontaneous physical activity and exercise-related energy expenditure can compensate in response to changes in energy intake or activity.
This means:
should be thought of as a time-varying quantity, rather than a fixed personal characteristic.
Levine and NEAT
James Levine and colleagues demonstrated large differences between individuals in changes in Non-Exercise Activity Thermogenesis (NEAT) during overfeeding (Levine, Eberhardt and Jensen, 1999).
When energy intake changes, people can unconsciously alter:
- movement,
- posture,
- fidgeting,
- standing,
- walking,
- and other spontaneous activity.
Therefore:
can occur.
This means the body's actual expenditure response may differ even when prescribed calorie intake or exercise is identical.
Pontzer and Constrained Energy Expenditure
Research by Herman Pontzer and colleagues, including work involving the Hadza hunter-gatherers, further challenged a purely additive model of energy expenditure. The constrained-expenditure interpretation is a model supported by observed cross-sectional patterns, not a rule that specifies a fixed amount of compensation for every individual (Pontzer et al., 2016).
A simple model might assume:
and therefore:
should produce approximately:
But under a constrained-energy-expenditure model, some of the additional activity expenditure may be compensated elsewhere.
For example:
might result in only:
of additional total expenditure.
The exact degree and mechanisms of compensation vary and remain an area of active research.
The important lesson for our purposes is simpler:
Conclusion: Two Dynamic Variables
Previous work gives us two separate dynamic variables.
First:
The number of calories corresponding to 1 kg of bodyweight change can vary because the proportions of FM and FFM vary.
Second:
TDEE changes with:
- bodyweight,
- body composition,
- activity,
- metabolic adaptation,
- spontaneous activity,
- exercise compensation,
- and other physiological responses.
Therefore, the real system is approximately:
and those body-composition changes feed back into:
creating a dynamic feedback system.
Where Smart Calorie Burn Begins
Most traditional approaches attempt to estimate TDEE from the bottom up:
But accurately measuring every component is difficult.
Instead, we have access to two quantities that can be repeatedly observed in normal users:
and:
If we know, or can reasonably estimate, the energy density of the observed weight change, then the relationship can be inverted.
Conceptually:
and:
Therefore:
This creates a different approach to estimating calorie expenditure.
Rather than attempting to perfectly calculate:
- BMR,
- exercise expenditure,
- NEAT,
- metabolic adaptation,
- exercise compensation,
- and every other physiological component,
we can attempt to infer the effective TDEE produced by all of them together from the observed relationship between calorie intake and bodyweight.
For example, if a person's expenditure falls by 150 kcal/day, it may not be necessary for the calorie-targeting algorithm to determine whether this came from:
- 60 kcal/day less expenditure because they became lighter,
- 40 kcal/day of metabolic adaptation,
- 30 kcal/day less spontaneous activity,
- and 20 kcal/day of exercise compensation.
For calorie prescription, the important quantity is the result:
Therefore, Smart Calorie Burn can treat TDEE as a:
that is continually inferred from observations.
This leads directly to the next problem:
Given noisy daily bodyweight measurements, imperfect calorie logging, variable body composition and a continuously changing TDEE, how can we estimate the user's current effective TDEE as accurately and quickly as possible?
That is the starting point for the Smart Calorie Burn v2 algorithm.
Mathematical Foundation of Smart Calorie Burn
The historical research establishes two important facts:
- The energy content of bodyweight change is not constant.
- Total Daily Energy Expenditure is not constant.
Therefore, estimating calorie requirements cannot be reduced to applying a fixed conversion such as:
or calculating TDEE once and treating it as permanent.
Smart Calorie Burn instead treats the problem as a dynamic estimation problem.
The goal is to estimate a quantity that cannot be measured directly in normal daily life:
where represents the person's effective Total Daily Energy Expenditure at time .
Energy Balance as the Governing Relationship
At its simplest, daily energy balance can be represented as:
where:
and:
If:
the person is in an energy surplus.
If:
the person is in an energy deficit.
Energy imbalance produces changes in the body's energy-containing tissues.
Therefore:
This relationship provides the fundamental link between the quantities that can be observed and the quantity that must be estimated.
Bodyweight Is Not a Single Energy Compartment
A change on the scale cannot be treated as though every kilogram has the same energy content.
For modeling purposes, it is safer to distinguish an underlying long-term tissue state from transient scale mass:
where:
and:
The transient term can include changes associated with:
- body water,
- glycogen,
- gastrointestinal contents,
- sodium balance,
- carbohydrate intake,
- and other short-term mass not represented by the long-term tissue compartments.
This definition deliberately uses , rather than conventional total FFM. Conventionally defined FFM already contains body water, glycogen, protein and minerals; adding water and glycogen on top of conventional FFM would double-count part of body mass. Hall's more detailed model likewise represents glycogen, glycogen-associated water and extracellular fluid explicitly (Hall et al., 2011, web appendix).
This distinction is important because changes in can substantially affect scale weight without representing an equivalent gain or loss of stored body energy. The term is not assumed to be literally energy-free: glycogen stores chemical energy, but glycogen plus its associated water cannot be converted using either the fat or lean-tissue density.
Therefore:
over short periods.
The model must separate long-term tissue change from short-term weight noise.
Energy Stored in Fat and Modeled Lean Tissue
Fat mass and modeled energy-associated lean tissue have substantially different effective energy densities.
A useful approximation is:
and:
These rounded constants come from Hall's model values of for fat and for lean tissue (Hall et al., 2011). They describe modeled tissue-energy changes and do not assign 1,800 kcal to every kilogram of short-term DXA FFM or scale-weight change.
Therefore, a change in stored body energy can be represented approximately as:
Substituting the approximate values:
This provides a more physiologically meaningful relationship than assuming every kilogram of bodyweight change represents 7,700 kcal.
If glycogen is modeled explicitly, its energy contribution should also be included:
where Hall's model assumes , approximately of glycogen, and about 2.7 g of associated water per gram of glycogen (Hall et al., 2011, web appendix). If glycogen is left inside the nuisance term , the two-tissue equation is an approximation that works best when endpoint glycogen levels are similar or their uncertainty is carried into the estimate.
Dynamic Energy Density of Weight Change
When fat and lean tissue change in the same direction, let the fraction of net tissue change coming from fat mass be represented by:
then:
represents the fraction arising from modeled lean tissue.
The effective energy density of tissue change becomes:
Therefore:
This convex-combination form requires and assumes that and have the same sign. It should not be used unchanged during body recomposition, when fat and lean tissue move in opposite directions. The general equation remains:
When net tissue change is nonzero, an interval-specific effective density may instead be defined as:
During recomposition this quantity can fall outside the interval from 1,800 to 9,400 kcal/kg or become unstable when net weight change is close to zero, so the two-compartment energy equation should be retained directly.
The value of is not assumed to be identical across all people or all phases of dieting.
Its expected value can be informed by variables associated with tissue partitioning, including:
where, conceptually:
- = adiposity/body-fat state,
- = protein intake,
- = resistance-training exposure,
- = magnitude or rate of energy restriction,
- = sex,
- = age.
The exact implementation used by Smart Calorie Burn is not simply a fixed deterministic equation. These variables provide information about the likely composition of bodyweight change and therefore the likely energy density associated with that change.
Direct Body-Composition Measurements
When DXA measurements are available, they provide periodic, noisy observations of fat mass and fat-free mass:
and:
Suppose two DXA observations are available at times and .
Then:
and:
DXA-derived FFM is not identical to the model's energy-associated lean-tissue compartment. Hydration changes can alter DXA fat and lean estimates even when the corresponding energy-containing tissue has not changed (Pietrobelli et al., 1998). A suitable observation model is therefore:
where represents hydration, glycogen-related mass and other variation embedded in measured FFM but not represented by , and represents DXA measurement error. Glycogen is not literally energy-free; if its change is material, it should be represented by a separate energy state as described above. Only after accounting for those terms should stored tissue-energy change be approximated as:
This gives the model periodic information about the person's actual body-composition trajectory rather than relying exclusively on population-level assumptions.
DXA observations are therefore treated as measurements with uncertainty and standardized scan conditions, rather than as perfectly error-free plug-in values.
Inferring Energy Expenditure
Returning to the energy-balance equation, must refer to true metabolizable intake rather than merely the logged value:
Rearranging gives:
Across a period containing multiple days:
Here measurements at times and bound complete daily intervals.
If average expenditure across the interval is represented by:
then conceptually:
with:
This equation expresses the central principle behind an adaptive TDEE estimator:
Logged calorie intake and observed changes in stored body energy contain information about expenditure, subject to the intake-observation model and its uncertainty.
However, direct application of this equation to short intervals would be unreliable because daily scale weight contains substantial noise.
Smart Calorie Burn therefore does not treat every individual daily weight change as tissue change.
TDEE as a Hidden Dynamic State
TDEE cannot normally be directly observed outside a laboratory.
It is therefore treated as a latent variable:
The model assumes that expenditure can change over time:
where:
represents changes in expenditure occurring between observations.
These changes can result from many mechanisms, including:
- changes in body mass,
- changes in fat-free mass,
- metabolic adaptation,
- changes in spontaneous physical activity,
- changes in exercise,
- changes in movement efficiency,
- thermic effects of food,
- and other physiological compensation.
The model does not need to identify exactly which biological mechanism produced every change in expenditure.
Instead, their combined effect appears in the estimated value of:
Thus:
represents effective real-world expenditure, regardless of the specific physiological mechanisms producing it.
State Representation
At a conceptual level, the physiological state of the user can be represented as:
An implementation that explicitly models glycogen can add as a separate state rather than absorbing it into .
These states evolve over time.
The stored-energy component follows approximately:
When glycogen is explicit, add to the right-hand side.
Meanwhile, observed scale weight follows:
where:
represents measurement error.
This creates two distinct processes:
Physiological Process
Observation Process
Separating these two processes prevents a one-day change in water weight from being interpreted immediately as a large change in body energy.
Information Available to the Model
Smart Calorie Burn can continuously incorporate observations including:
together with relatively stable characteristics such as:
and information related to body composition and training:
These variables serve different purposes.
Logged calorie intake provides imperfect information about energy entering the system. A simple intake-observation model is:
where represents persistent logging or food-label bias and represents day-to-day error. The physiological energy-balance equation uses , while the application directly observes only . If the implementation does not estimate or otherwise account for , its output should be described as an effective TDEE conditional on logged intake, not an unbiased laboratory measurement of physiological expenditure.
Logged calorie intake provides indirect information about energy entering the system.
Daily bodyweight provides information about the resulting trajectory.
Protein intake, resistance training, body fat and body composition provide information about likely fat/lean-tissue partitioning.
Carbohydrate intake can provide contextual information about short-term glycogen and water fluctuations.
Age, height, sex and body composition provide useful prior information about plausible energy expenditure.
Periodic DXA measurements provide stronger observations of the underlying fat and lean compartments.
Prior Estimates Versus Observed Evidence
At the beginning, little person-specific longitudinal information may be available.
The system therefore begins with a plausible range for:
based on known characteristics of the individual.
Conceptually:
Similarly, expected tissue partition can begin from physiological population-level relationships:
These should be understood as priors, not truths.
As longitudinal data accumulate, observations provide increasing amounts of person-specific information.
Conceptually:
As more high-quality data become available, the model can rely progressively less on generic population assumptions and more on the observed response of the individual.
Why Multiple Days Are Required
Consider a person whose scale weight falls by:
overnight.
Interpreting that as tissue loss using even a modest energy density would imply an impossible daily energy deficit.
Therefore:
cannot be interpreted directly as:
Instead, the model extracts information from the trajectory of repeated observations.
A sustained trend contains much more information about tissue change than a single measurement.
Conceptually:
provides evidence about:
while short-term deviations are more likely to be explained through the transient component:
For this reason, Smart Calorie Burn is fundamentally a sequential estimator, rather than a calculator based on isolated measurements.
Adaptive Updating
Each new observation provides additional evidence about the hidden physiological state.
Conceptually:
is updated when new observations become available.
The previous estimate becomes the starting belief:
and new data modify that belief:
This is the general Bayesian structure underlying adaptive state estimation.
It means the algorithm does not need to throw away everything it previously learned whenever a new weigh-in occurs.
Instead, new evidence is combined with the existing estimate according to its consistency, reliability and informational value.
The exact estimation, weighting, uncertainty and adaptation procedures used by Smart Calorie Burn are implementation details of the algorithm.
Why TDEE Can Change Without Breaking the Model
Suppose the current estimated expenditure is:
The user continues consuming approximately:
Initially, their observed trajectory may be consistent with approximately:
of energy deficit.
After substantial weight loss, their expenditure may fall.
For example:
Their new deficit becomes:
The system does not require us to predetermine exactly how much of the 150 kcal/day reduction resulted from:
- lower body mass,
- metabolic adaptation,
- reduced NEAT,
- exercise compensation,
- or some combination of these.
The observed trajectory provides evidence that the person's effective expenditure has changed.
Therefore:
rather than remaining locked to the value estimated at onboarding.
From Estimated TDEE to Calorie Targets
Once current TDEE and the expected energy density of future weight change are estimated, calorie targets can be derived.
Let:
represent the desired rate of weight change in kg/day.
Let:
represent the expected energy density of that change. Because tissue partition can differ between loss and gain, must be estimated for the intended direction and conditions; a loss-derived partition should not automatically be reused for weight gain.
Then the required daily energy-imbalance rate is approximately:
For weight loss, where the desired change is negative:
For example, if:
the model can calculate the approximate energy deficit required to produce that tissue-loss trajectory.
For weight gain:
and the same general equation produces the required surplus.
Thus the calorie recommendation depends on two adaptive estimates:
rather than assuming either TDEE or kcal/kg is permanently fixed.
Closing the Feedback Loop
After a calorie target is prescribed, the process does not end.
The user continues producing new observations:
These observations are compared with the trajectory implied by the current physiological state.
The estimates are then updated.
Therefore Smart Calorie Burn operates as a closed-loop system:
This is fundamentally different from calculating TDEE once and using the same value indefinitely.
What Smart Calorie Burn Is Estimating
The objective is not to claim that every component of human metabolism can be measured perfectly from consumer data.
The objective is narrower and more practical. Because the application observes logged rather than laboratory-measured intake, this is an effective estimate conditional on the intake-observation model:
while accounting for:
- changing body composition,
- differences in tissue energy density,
- short-term bodyweight noise,
- metabolic adaptation,
- changing activity expenditure,
- and uncertainty in the observations.
In mathematical terms, the problem is therefore one of latent-state estimation under noisy observations.
The available data provide repeated indirect measurements of an otherwise difficult-to-observe quantity:
and the model continually refines that estimate as the individual generates more data.
This is the mathematical foundation of Smart Calorie Burn.
Handling Real-World Data Problems
Real-world nutrition and bodyweight data are messy.
People miss meals, forget to log days, eat differently on weekends, travel, attend parties, start creatine, change carbohydrate intake, retain water during parts of the menstrual cycle, and occasionally produce scale changes that have almost nothing to do with changes in body fat.
An adaptive calorie algorithm therefore cannot assume that every observation is equally reliable or that every change in bodyweight represents a change in stored body energy.
Smart Calorie Burn is designed to recognize these situations and prevent short-term disturbances from unnecessarily affecting calorie and macro prescriptions.
Transient Weight Changes
Recall that observed scale weight can be represented conceptually as:
where:
represents transient weight that is not equivalent to long-term changes in energy-containing tissue.
Examples include changes in:
- body water,
- glycogen,
- sodium balance,
- gastrointestinal contents,
- creatine-associated water retention,
- menstrual-cycle-related fluid shifts,
- and other temporary mass shifts.
Ordinary scale measurement variability is represented separately by .
The important principle is:
Smart Calorie Burn therefore compares new observations with the trajectory predicted by the current model.
If a weight change is substantially inconsistent with what could reasonably be explained by the recorded calorie intake and expected tissue-energy change, the algorithm can treat part of that observation as transient weight rather than immediately interpreting it as fat or lean-tissue gain or loss.
This prevents temporary disturbances from unnecessarily changing calorie targets.
Creatine Use
Starting creatine supplementation can increase total body water and body mass in some users (Powers et al., 2003).
This can cause:
and may also appear as an increase in DXA-derived lean mass.
However, this increase does not represent an equivalent amount of newly synthesized energy-containing tissue.
Therefore, a rapid weight increase following the introduction or substantial change in creatine use should not automatically be interpreted as:
Instead, creatine-related changes can be treated as a potential transient-weight disturbance.
Conceptually:
with part of the observed change temporarily assigned greater probability of belonging to:
rather than to actual energy-containing tissue.
The same principle applies when interpreting body-composition measurements obtained near major changes in creatine use.
Menstrual-Cycle-Related Weight Changes
For users who menstruate, bodyweight can fluctuate systematically across the menstrual cycle.
These fluctuations are primarily important to Smart Calorie Burn as a source of temporary measurement noise, rather than as evidence that the energy density of body tissue has suddenly changed.
Therefore, cycle information can be used to modify the model's confidence in short-term scale-weight observations.
Conceptually, during periods where greater fluid variation is expected:
meaning the model becomes less willing to interpret an abrupt scale change as a large change in stored body energy.
The underlying calorie prescription should therefore be protected from unnecessary reactions to predictable fluid fluctuations.
Carbohydrate and Glycogen Changes
Stored carbohydrate is associated with glycogen and accompanying water. A commonly used physiological approximation is roughly 3–4 g of associated water per gram of glycogen, although the relationship is context-dependent (Olsson and Saltin, 1970, summarized by Kreitzman et al., 1992); Hall's dynamic model uses approximately 2.7 g water per gram of glycogen (Hall et al., 2011, web appendix). Smart Calorie Burn need not assume either value as an exact person-specific conversion.
A substantial increase or decrease in carbohydrate intake can therefore alter bodyweight over a short period without representing an equivalent change in fat or lean tissue.
For example:
can lead to:
and:
producing:
even when the actual energy deficit would not explain the full observed weight change.
Because Smart Calorie Burn already receives macronutrient information, abrupt changes in carbohydrate intake can provide useful context when evaluating unusual short-term weight movements.
The purpose is not to convert every gram of carbohydrate into an exact predicted water-weight correction.
Instead, carbohydrate changes provide additional evidence about whether an unexpected weight movement is likely to represent:
or:
Sodium and Other Water-Balance Effects
Large changes in sodium intake can similarly affect fluid retention.
Sodium is not a user input in MacroCodex
Smart Calorie Burn can continue to operate by treating unexplained short-term deviations as uncertain observations and allowing subsequent measurements to determine whether the change persists.
The general principle is:
Prediction Residuals and Unexpected Changes
At every point, the current physiological state implies an expected bodyweight trajectory.
Let:
represent the weight predicted by the model and:
represent the actual measurement.
The difference:
is the prediction residual.
Small residuals are expected because bodyweight is naturally noisy.
An unusually large residual indicates that something occurred which is not well explained by the current estimate of calorie intake, TDEE and tissue-energy change.
Possible explanations include:
- fluid retention or loss,
- glycogen changes,
- unusual sodium intake,
- creatine use,
- gastrointestinal contents,
- inaccurate calorie logging,
- missed calorie logs,
- measurement error,
- or a genuine change in energy expenditure.
The algorithm therefore does not need to immediately decide that every unexplained residual represents one specific biological mechanism.
Instead, it can reduce the influence of observations that are inconsistent with the surrounding trajectory until additional evidence clarifies what occurred.
Thus:
This protects calorie and macro prescriptions from overreacting to short-term noise.
Missing and Incomplete Calorie Logs
Another unavoidable real-world problem is missing calorie-intake information.
A user may:
- completely forget to log a day,
- log only part of a day,
- miss several meals,
- or stop logging temporarily.
A missing logged calorie value cannot simply be interpreted as:
That would create a fictitious enormous calorie deficit and corrupt the TDEE estimate.
Instead, the observation is treated as:
The system can then estimate a plausible value using the person's historical behavior.
Gap Filling
Suppose a user forgets to log calories on Sunday.
Rather than using a generic population average, the algorithm can examine that user's own historical pattern.
For example, previous Sundays may show:
This provides evidence that Sunday's expected intake is approximately within that range.
Conceptually:
The estimate can incorporate patterns such as:
- previous Sundays,
- weekdays versus weekends,
- recent calorie intake,
- recurring weekly behavior,
- variability in the user's intake,
- holidays or known unusual days where information is available,
- and longer-term eating patterns.
For some users:
For others there may be little difference.
The important point is that gap filling should be personalized to the individual's observed behavior, rather than assuming that everyone behaves similarly.
Gap Filling Is an Estimate, Not Ground Truth
No algorithm can reconstruct information that was never observed with perfect accuracy.
Suppose a user usually consumes:
on Sundays.
The model may therefore estimate a missing Sunday at approximately:
But imagine that this particular Sunday was the user's best friend's birthday and the actual intake was:
There may be nothing in the existing data that allows the algorithm to know this.
The algorithm can make the best inference supported by available evidence, but:
The uncertainty associated with an imputed day should therefore be greater than the uncertainty associated with a completely logged day.
Conceptually:
This allows the algorithm to use the estimated information without pretending that it is equally reliable.
Why Complete Logging Still Matters
Smart Calorie Burn is designed to tolerate imperfect data.
That does not mean missing data are free.
The more complete the information supplied by the user, the more accurately the system can distinguish:
from:
and:
When information is missing, the system can make an educated inference from previous behavior.
But an inference can occasionally be wrong.
Therefore:
The algorithm's purpose is not to demand perfect logging.
Its purpose is to remain useful when real-world data are imperfect while recognizing the additional uncertainty created by those gaps.
Preventing Bad Data From Affecting Prescriptions
The final objective of these mechanisms is not merely to produce cleaner graphs.
It is to prevent bad or temporary information from unnecessarily changing the user's calorie and macro prescription.
For example, a sudden:
scale increase following high carbohydrate intake should not cause the algorithm to conclude immediately that TDEE has collapsed.
Likewise, a sudden:
change following glycogen depletion should not immediately cause a large upward revision in estimated TDEE.
A missing high-calorie day should also not be interpreted with the same confidence as a completely logged day.
The model therefore considers:
and:
before allowing unusual observations to meaningfully alter calorie prescriptions.
In simple terms:
Validating Smart Calorie Burn
How Can a User Tell Whether Smart Calorie Burn Works?
The mathematics behind an adaptive calorie algorithm can become complicated.
But evaluating whether the algorithm works is surprisingly simple.
Imagine a car manufacturer claims that a new engine uses advanced space technology to improve fuel efficiency.
You do not necessarily need to understand the engineering inside the engine to test the claim.
You can put a known amount of fuel into the vehicle, drive it, and measure how far it travels.
If the vehicle consistently travels substantially farther on the same amount of fuel, then the improvement is measurable regardless of how complicated the internal technology is.
Smart Calorie Burn can be evaluated in the same way.
Maintenance
At true maintenance:
Therefore:
and over a sufficiently long interval:
Short-term scale fluctuations will still occur because of water, glycogen and gastrointestinal contents.
But the long-term bodyweight trend should remain approximately stable.
Therefore, if Smart Calorie Burn prescribes:
as maintenance and the user consistently consumes approximately that amount, their long-term weight trend should remain close to maintenance.
If instead they consistently lose weight, the estimated maintenance intake was probably too low.
If they consistently gain weight, it was probably too high.
Weight Loss
Suppose the user selects:
Smart Calorie Burn calculates a calorie target intended to produce approximately that rate of bodyweight change.
The user then consistently follows the prescribed calorie intake.
If the algorithm is well calibrated, the observed long-term trajectory should approach:
subject to normal biological and measurement variability.
The important comparison is therefore:
Weight Gain
The same test works in the opposite direction.
Suppose the user selects:
The algorithm calculates the surplus required to produce that target.
If the person consistently follows the prescribed intake, their observed weight trajectory should approach:
again allowing for short-term fluctuations and uncertainty in the composition of gained weight.
A Direct Test of Calibration
The user therefore has three simple modes:
Each one creates a measurable prediction.
For maintain:
For loss:
For gain:
The effectiveness of the algorithm can therefore be evaluated by comparing:
against:
over time.
Prediction Error
A simple way of expressing this is:
For example, if the target is:
and the user actually loses:
then:
The closer:
the better calibrated the calorie prescription is to the user's observed response.
This can also be evaluated across many weeks rather than judging the system from a single short interval.
Algorithm Makes Falsifiable Predictions
This is an important property of Smart Calorie Burn.
The model does not merely display a number called "maintenance calories."
It uses that estimate to make a prediction about what should happen next.
For example:
Eat approximately (X) calories per day and your expected long-term weight-change rate is (Y).
That prediction can subsequently be compared with reality.
If the user consistently follows the prescribed target but repeatedly experiences a materially different trajectory, the model is wrong or insufficiently calibrated.
The new observations then provide evidence for updating the estimate.
Thus:
is not merely how Smart Calorie Burn operates internally.
It also provides a direct way to measure whether the algorithm is performing well.
Scale Provides the final Test
The purpose of Smart Calorie Burn is not to produce the most impressive-looking TDEE number.
The purpose is to prescribe an intake that produces the user's requested outcome.
If the user selects:
Maintain
their long-term bodyweight should remain approximately stable.
If the user selects:
Lose
their long-term weight trajectory should approach the selected rate of loss.
If the user selects:
Gain
their long-term trajectory should approach the selected rate of gain.
Therefore, the ultimate practical test is simple:
If predicted and observed outcomes repeatedly agree, then the estimated energy requirements are well calibrated to that individual.
If they do not agree, the discrepancy becomes new information that the adaptive model can use to improve its next estimate.