"I don't really understand how Libra calculates your projected date for reaching your goal... why does my projected goal date keep moving back? On Sunday it was October 2018 and today it's February 2020??"

That was a post on r/loseit. The poster had gone from 214.2 lb to 217.2 lb and back to 214.2 lb in one week, and the app's date had moved by sixteen months. The same question keeps coming back with different apps in it. On r/MacroFactor, a thread titled "Projected Goal end date keeps changing" said the "projected end date" moved every day, "which is unexpected." On r/loseit in mid-2026, a Lose It! user saw a plan date of December 7th and a date from their logged weigh-ins of March 20th, and asked: "Is that really my goal date?" And in August 2026, the plainest version: "How long is it going to take to lose 30 pounds?"

If you build a weight tracker, a habit app or any chart of a noisy daily number, you will eventually be asked to add "you'll reach your goal by..." The formula is one division. The hard part is that the number you divide by is noisy, and a division by a noisy number near zero does exactly what those posters saw.

This post builds a small, dependency-free JavaScript module that produces two kinds of goal date (a plan date and an observed date), reports a range instead of a single day, and refuses to print a date when the data cannot support one. It comes with a node --test suite of 14 tests, and every number in the two charts below is checked by those tests. Nothing here is medical or diet advice. A goal date is a forecast, and the code treats it as one.

Who asks, and what they actually want

Reading through the threads, three groups ask this question, and they want slightly different things.

  • People whose date jumped. The Libra and r/MacroFactor posters. They want to know whether something is broken.
  • People comparing two dates. The Lose It! user wondered whether to "average out the two." They want to know which one to believe.
  • People who want a number before they start. The August 2026 r/loseit poster (164 lb, aiming for "130-ish") got one reply doing the arithmetic by hand: a 500-calorie daily deficit, one pound a week, "30 weeks." They want a date and some idea of how firm it is.

On X the pattern is the same, with a sharper edge: in August 2026 someone wrote that the predicted date on their app "keeps moving later and later," and blamed themselves for it. That one matters for product design. A forecast that swings by months because of water weight should not read like a verdict on the user.

There are at least three different "goal dates"

Most confusion comes from apps showing one of these and users assuming another:

  1. Straight-line plan date. Pick a pace, divide. 34 lb at 1 lb per week is 34 weeks. No weigh-ins needed.
  2. Adaptive plan date. Same pace at the start, but the planner models expenditure falling as weight falls, so the line curves and the date moves later.
  3. Observed date. Fit a line through your recent weigh-ins, measure the pace you are actually losing at, and divide by that.

The Lose It! user's December and March dates are almost certainly a plan date and an observed date. They answer different questions ("what happens if I stick to the plan exactly?" versus "where is my recent data heading?"), so averaging them doesn't give you anything meaningful. A good UI labels them separately.

Why the date jumps: you are dividing by a noisy number

Every observed-date feature reduces to this:

// rate is signed: negative = losing. Returns Infinity when the trend is flat or going the wrong way. export function daysToGoal(currentKg, goalKg, rateKgPerDay) { const remaining = goalKg - currentKg; if (rateKgPerDay === 0 || Math.sign(remaining) !== Math.sign(rateKgPerDay)) return Infinity; return remaining / rateKgPerDay; } 

Differentiate it with respect to the rate and you get the whole story:

|d days / d rate| = remaining / rate² 

The date's sensitivity to an error in the pace grows with the square of how slow the pace is. Halve the pace and the date doubles, but the date's wobble quadruples.

Why does my projected goal date keep changing: left, weeks until 34 lb is gone plotted against measured pace, a hyperbola where plus or minus 0.25 lb per week gives 27 to 45 weeks at 1 lb per week but 52 to 227 weeks at 0.4 lb per week; right, a plan with constant deficit reaching 80 kg in 155 days versus a plan with expenditure recalculated daily reaching it in 181 days
Why does my projected goal date keep changing? Left: the date is remaining weight divided by pace, so the same pace error is worth ten times more at a slow pace. Right: two plan dates for the same starting pace.

Take the r/loseit numbers: 34 lb to go. If your measured pace is 1.0 lb per week and the estimate is off by a quarter of a pound either way, the date lands anywhere from 27 to 45 weeks out. Now suppose a slow few weeks drag the measured pace down to 0.4 lb per week. The same plus or minus 0.25 lb per week now spans 52 to 227 weeks. The error didn't change; the division did. That is the Libra poster's sixteen-month jump: a 3 lb bump (they put it down to their cycle) flattened the recent slope, and the date ran off towards 2020.

When the slope crosses zero, the honest answer is no date at all. daysToGoal returns Infinity, and the UI should say "no estimate right now" rather than print a year in the 2030s.

Measuring the pace: window length matters more than the formula

Apps estimate the pace with a straight-line fit over a recent window. Libra's documentation says it runs a simple linear regression over the trend values inside a forecast window that "defaults to 7 days." TrendWeight's published notes describe a best-fit line "through your last 14 days of trend data." Neither is wrong. They are trade-offs, and you can see them by replaying one log every morning.

Why does my projected goal date keep changing: top, 120 days of synthetic daily weigh-ins losing 0.4 kg per week with a two-week 0.8 kg water bump; bottom, the projected day the 72 kg goal is reached, recomputed every day, with a 7-day window that jumps and often shows no date and a 28-day window with a 95 percent range band that stays near the true day 140
Why does my projected goal date keep changing? The same log forecast every morning: a 7-day window swings and often has no date; a 28-day window is calmer and shows its own range.

The log in that chart is synthetic and seeded: an underlying loss of 0.4 kg per week, random day-to-day noise with a standard deviation of 0.5 kg (an assumption for illustration, not a measured statistic about real people), and a two-week bump of +0.8 kg to imitate water retention. The true line reaches the 72 kg goal on day 140. Replaying it from day 27 to day 119:

  • 7-day window: no date at all on 27 of 93 mornings, and a median day-to-day jump in the projected finish of 24.6 days.
  • 28-day window: a date every morning, and a median jump of 4.9 days.

During and after the water bump, the 28-day line drifts later, then comes back. That's correct for a forecast that only knows the last four weeks, and it's exactly what users experience. A longer window doesn't make the date right; it makes it move less for reasons that aren't real.

There's one more decision hidden in "fit a line." Libra and TrendWeight fit the smoothed trend values, which gives a calmer line. That's fine for the middle estimate. But if you also want an error bar, fit the raw weigh-ins. Smoothed values are built from each other, so they are not independent, and the textbook standard error of the slope will come out far too small. My module fits raw weigh-ins for both the slope and its standard error, and flags that assumption in a comment: it treats day-to-day noise as roughly independent, which real scale data won't satisfy perfectly.

The plan date: why the straight line is optimistic

Before there are any weigh-ins, all you have is a plan. The common shortcut is the 3,500 kcal per pound rule (about 7,700 kcal per kg). Thomas and colleagues, in a 2014 commentary in the Journal of the Academy of Nutrition and Dietetics, traced that rule back to Max Wishnofsky's 1958 paper. Their argument is that, as people apply it, it assumes the energy content of lost weight is constant and that expenditure doesn't change as weight falls, and neither holds. They describe the energy content of early weight loss as substantially lower, approaching the 3,500 figure only in the slower later phase. Hall and colleagues' 2011 Lancet modelling paper reports that the bodyweight response to a change in intake is slow, "with half times of about 1 year."

You don't need a research-grade model to show the direction of that effect. The weight loss calculator on Body Visualizer draws two curves: a solid one where intake is fixed on day one and expenditure is recalculated daily with the Mifflin-St Jeor equation, and a dashed one that keeps the starting deficit constant at 7,700 kcal per kg. The page says plainly that it's a simplified model and not the NIH Body Weight Planner. Its default example (male, 30, 180 cm, 90 kg to 80 kg, light activity, 1 lb per week) shows 155 days for the straight line and 181 for the daily simulation. My planDates function reproduces both numbers, and so does the right panel of the first chart.

export function planDates({ sex, ageY, heightCm, startKg, goalKg, activity, kgPerWeek }) { if (!(goalKg < startKg)) throw new RangeError("this planner only handles loss: goal must be below start"); if (kgPerWeek > MAX_PLAN_LB_PER_WEEK * KG_PER_LB + 1e-12) throw new RangeError(`pace above ${MAX_PLAN_LB_PER_WEEK} lb/week is refused by this tool`); const tdee = (w) => mifflin({ sex, ageY, heightCm, weightKg: w }) * activity; const deficit0 = (kgPerWeek * KCAL_PER_KG) / 7; const intake = tdee(startKg) - deficit0; // fixed on day 0 const straightDays = Math.ceil(((startKg - goalKg) / kgPerWeek) * 7); let w = startKg, d = 0; while (w > goalKg && d < MAX_HORIZON_DAYS) { w -= (tdee(w) - intake) / KCAL_PER_KG; d++; } return { intake, deficit0, straightDays, adaptiveDays: w <= goalKg ? d : null }; } 

The refusal above 2 lb per week is a product choice: CDC's "Steps for Losing Weight" page describes "about 1 to 2 pounds a week" as a gradual, steady pace, so the tool won't draw a plan outside that.

A small testing lesson fell out of this. The calculator page displays the default as 198.4 lb, 176.4 lb and 5 ft 10.9 in. Feed those rounded display values back into the same code and you get 154 and 180 days, one day off each. Store the metric values the user typed, and round only for display. A golden-value test is what caught it.

The observed-date module

Here's the core of the forecaster. It returns a status for every case, and only some statuses carry a date.

export function forecastGoal({ entries, goalKg, windowDays = 28, minEntries = 7, horizonDays = 730 }) { const pts = entries.map((e) => ({ x: dayNumber(e.date), y: Number(e.kg) })) .filter((p) => Number.isFinite(p.y)).sort((a, b) => a.x - b.x); if (pts.length === 0) return { status: "no-data" }; const today = pts[pts.length - 1].x; const win = pts.filter((p) => p.x > today - windowDays); // calendar days, not "last N entries" if (win.length < minEntries) return { status: "not-enough-data", n: win.length, needed: minEntries }; const fit = olsFit(win); // slope, intercept, slope standard error const nowKg = fit.intercept + fit.slope * today; // fitted today, not the last noisy reading const losing = goalKg < pts[0].y; if (losing ? nowKg <= goalKg : nowKg >= goalKg) return { status: "at-goal", nowKg }; const t = t95(fit.n - 2); const fast = fit.slope - t * fit.se, slow = fit.slope + t * fit.se; if (losing ? fit.slope >= 0 : fit.slope <= 0) return { status: "not-moving-toward-goal" }; const mid = daysToGoal(nowKg, goalKg, fit.slope); const optimistic = daysToGoal(nowKg, goalKg, losing ? fast : slow); const pessimistic = daysToGoal(nowKg, goalKg, losing ? slow : fast); // Infinity if the band crosses zero if (mid > horizonDays) return { status: "beyond-horizon", horizonDays }; // ...returns { status: "ok" | "ok-open-ended", days: mid, daysRange, date, dateRange } } 

A few decisions worth calling out:

  • The window is calendar days. If someone weighs in every third day, a 28-day window still means four weeks, and the test suite checks that skipped days don't bend a clean slope.
  • "Today" is the fitted value, not the last reading. Starting the countdown from one heavy morning is a second source of jumps.
  • The range comes from the slope's standard error. When the slow end of the band reaches zero, there's no honest latest date, and the status becomes ok-open-ended.
  • There's a horizon. Libra's documentation says its forecast line only extends six months; the Body Visualizer calculator rejects simulations longer than 730 days. Past your horizon, say so instead of printing a date.

Then the display text, which has its own test because it's what users actually read:

formatForecast(f, { unit: "lb" }); // "Estimated: around Jan 2027 if your recent pace of about 1.0 lb/week continues. This will move as you log." // "Estimated: Dec 2026 to May 2027 if your recent pace of about 0.3 kg/week continues. This will move as you log." // "No date estimate: your recent trend is flat or moving away from the goal. That is common for a week or two." 

Months, not days. "If your recent pace continues," not "you will." And a sentence that tells the user the date is supposed to move, which answers the r/MacroFactor question before anyone has to ask it.

The tests

Fourteen tests, run with node --test, no dependencies. They check:

  • The core formula and its sensitivity. 34 lb at 1 lb per week is 238 days; a flat pace gives Infinity; remaining / rate² matches a numerical derivative; plus or minus 0.25 lb per week gives 190 to 317 days at 1 lb per week and 366 to 1,587 at 0.4.
  • Golden values. Mifflin-St Jeor gives 1,880 kcal for the calculator's default man; the plan reproduces its 2,086 kcal intake, 2,585 kcal maintenance, 155 days and 181 days.
  • Rounding. Rounded display values give 154 and 180 days.
  • Refusals and statuses. Paces above 2 lb per week throw; no data, too little data, flat, rising, at goal and beyond the horizon all return a status, never a date.
  • OLS. Exact on a perfect line, and the slope's standard error matches a hand calculation.
  • Missing days and window length. Sparse logs keep their slope, and the 7-day versus 28-day numbers quoted above (27 empty mornings, 24.6 versus 4.9 days median jump) are asserted exactly.
  • Display text. It starts with "Estimated," says it will move, and contains no "you will," "guarantee" or exact day.
  • Charts match code. The chart script plots a JSON fixture written by the module, and a test regenerates it and compares.
$ node --test ... ℹ tests 14 ℹ pass 14 ℹ fail 0 

Fix the rate or fix the date?

The r/MacroFactor poster wanted the date fixed and the calorie target to move. A March 2026 thread in the same subreddit asked for the reverse: a goal weight "without a goal date," so a slow week pushes the date out instead. The top reply in the June 2025 thread said the app already works that way: "it keeps your goal rate the same and changes the end date."

Both are legitimate designs, and they fail differently. Fixing the rate means the date moves, which is honest but needs the explanation above. Fixing the date means the required pace moves, and after a few slow weeks it can climb past anything sensible. If you pick that design, cap the pace and tell the user the date no longer fits, the way the Body Visualizer calculator shows the earliest date within its limits instead of an unsafe intake.

What to put in the UI

A short checklist that follows from the code:

  1. Label plan dates and observed dates separately, and never average them.
  2. Show a range in months, computed from the slope's uncertainty, with "if your recent pace continues."
  3. Use a window of a few weeks, not one, and count it in calendar days.
  4. Show "no estimate right now" when the trend is flat, and stop at a horizon.
  5. Start the countdown from the fitted trend, not the latest reading.
  6. Frame movement as normal. A date that moved after a water-heavy week isn't a failure, and the copy shouldn't make it sound like one.
  7. Give users a way to hide the date entirely.

A date is also an abstract thing to aim at. In the Body Visualizer weight simulator you can fix a height and drag the weight slider between today's and the goal value, and the height and weight simulator gives BMI context alongside a 3D preview. The BMI there is plain arithmetic on the numbers entered. The silhouette is an estimate from a generic model, not a scan, and neither tool predicts when anyone will get there.

So, why does the projected goal date keep changing?

Because it is remaining weight divided by a pace measured from a few noisy weeks, and division by a slow, noisy pace amplifies every water-weight wobble by the square of how slow it is. A plan date that ignores falling expenditure adds a second, more predictable drift: the straight line is optimistic. Neither is a bug in the arithmetic. They become bugs in the product when the app prints one confident day, starts the count from one heavy morning, or shows a year in the 2030s instead of admitting it doesn't know yet. All of that is fixable in under 200 lines of JavaScript and a test file.

Sources