Reference · Methodology

The line through the noise.

HackDiet draws an exponentially-smoothed trend through every weight you log. This page is the math that makes that line — exactly which formula, with which constant, and what it does and doesn't tell you.

Looking for what a specific number on a specific screen means? The manual tours every screen with screenshots, and catalogues every visible card, label, and value alongside its formula.

Two numbers, one source

Every morning's weight feeds two things: an exponentially-smoothed trend, and (when you set a goal) an ordinary least-squares regression slope over a recent window. Both are pure functions of weights you've already typed in. There's no model, no AI, no opaque "wellness score" — just two well-known statistical operations applied to your own data.

The trend (exponential moving average)

On each day you log a weight, the trend updates by the simple recurrence:

trend = trend + (weight − trend) × 0.1

That's the EMA, with smoothing constant α = 0.1. It's the same value John Walker chose in The Hacker's Diet (1991): slow enough to ignore the ±1 kg overnight noise, fast enough to follow real trajectory changes within a couple of weeks. Days you don't log are skipped — the trend doesn't drift on its own.

The trend is what the chart line tracks, and it's the value the rest of the app reasons about. It is not a prediction; it's a smoothed view of the past.

The slope (ordinary least squares)

For "are you on track?" answers, HackDiet fits a straight line through the trend values inside a chosen window — typically the last 14, 28, or 90 days — using ordinary least-squares regression. The slope of that line is your weekly rate in kilograms per week, multiplied by 7.

That weekly rate also translates to an implied daily calorie balance via the long-standing 7716 kcal-per-kilogram-of-body-mass approximation:

kcal/day = (kg/week × 7716) ÷ 7

This is an approximation of mixed fat-and-lean tissue energy density, accurate enough at the timescales weight tracking operates on, and stable enough to compare two months side by side.

Time-to-goal, not date-of-goal

When you have a goal weight set, HackDiet reports how many weeks of math separate today's trend from your goal at the current slope. It deliberately does not print a calendar date.

A calendar date implies a forecast — a contract with the future. Weeks-of-math at the current rate is just arithmetic over your past readings: if today's slope keeps holding, the line crosses the goal in n weeks. The slope will shift as you adapt, so the number changes; that's the feature, not a bug. Use it as a checkpoint, not a deadline.

What HackDiet doesn't do

Provenance

The methodology comes from John Walker's The Hacker's Diet (1991), available free at fourmilab.ch. HackDiet is an independent implementation; it is not affiliated with or endorsed by Walker's estate. The constants (α = 0.1, 7716 kcal/kg) are taken verbatim from the book; the regression window options and the time-to-goal output are HackDiet's own.

Built into the app at the Stats tab. Prefer to read it here? You're already done.