peptrendGet the app

Why your trend line lags behind the scale (SMA vs EWMA)

A trend line lags because it averages weigh-ins you already took, and how far back it reaches is the setting. At the shipped defaults the 7-day SMA sits 3 days behind and the EWMA at alpha 0.10 sits 9 days behind. On this user's log the SMA moves 0.295 lb per point where the EWMA moves 0.103, for near-identical noise rejection, because the SMA's window drops an old weigh-in out the back each day.

A hard-edged rectangular frame over equal-height bars, one bar tumbling away at the left as another enters at the right, with a line kicking below.

Which lags less, a 7-day average or an EWMA? The SMA — at 2.9 times the movement

Run the two methods over one user’s log — 84 weigh-ins over 225 days — and the 7-day simple moving average moves 0.295 lb from one point to the next, ignoring 74.7% of the scale’s own daily movement. The EWMA at its default alpha of 0.10 moves 0.103 lb and ignores 75.9%. A little over a percentage point apart on rejection. A factor of 2.9 apart on movement.

So which one lags less? By the standard measure, the average age of the data behind today’s number, the SMA does. A 7-day window sits 3 days back. An EWMA at alpha 0.10 sits 9 days back. The SMA buys that shorter memory with a line that twitches, and the twitching has one cause: every day, a weigh-in leaves.

The end of the series muddies the picture rather than settling it. On this user’s log the SMA finishes at 184.7 lb and the EWMA at 184.5, with the last scale reading at 183.0 in a period that lost 22.0 lb overall. The laggier filter by formula ends up the lower of the two, by less than two tenths of a pound. Lag computed from a weighting function and lag observed at the right-hand edge of one real series are different quantities, and the second one is not reliable enough to pick a method on.

Why does a 7-day average move on a day your weight barely changed?

A simple moving average updates by adding one value and subtracting another:

SMA_next = SMA_prev + (W_new − W_old) / N

Two terms. Both are raw scale readings, both carry the full spread of a daily weigh-in — on this user’s log the standard deviation of the day-over-day change is 1.45 lb against an underlying drift of 0.098 lb/day. Today’s step in the line is a fact about this morning and a fact about a week ago in equal measure.

That is why an outlier costs twice. This user’s log’s largest single-day swing is 5.4 lb. A weigh-in that far from the one it displaces moves a 7-day window by 5.4 ÷ 7 ≈ 0.8 lb on the day it enters, then roughly the same again with the sign flipped on the day it drops off the back. Nothing happened on the scale that second morning. The window just forgot something, all at once.

Multiply the SMA’s 0.295 lb of movement back out by its window and you get about 2.1 lb — the average distance between two weigh-ins seven steps apart in that file. Every step the line takes is a seventh of that week-old gap.

None of this makes the moving average a poor filter. For a fixed edge sharpness it is optimal at reducing random white noise in the time domain, which is exactly the job here. The double counting is the price of a rectangular window, and the price is paid in movement.

Why does an EWMA move so much less than a moving average?

Subtract yesterday’s EWMA from today’s and one term survives:

T_t = α·W_t + (1 − α)·T_{t−1}
T_t − T_{t−1} = α·(W_t − T_{t−1})

Today’s reading against the line that was already there, scaled by alpha — the whole of the EWMA in one line of arithmetic. No second term, because no observation is ever discarded. Old weigh-ins fade instead: the weights α(1−α)^t decrease geometrically and sum to one. At alpha 0.10 a single weigh-in’s influence halves every 6.6 days and never reaches zero.

That single term also lets you read the measured numbers backwards. Divide the EWMA’s 0.103 lb of line movement by alpha 0.10 and you get 1.03 lb: the average distance between a day’s value and the line it arrived at. Compare that with the mean day-over-day change of 1.16 lb on the same file. The line sits roughly one day’s worth of noise away from the scale at any moment, and moves a tenth of that distance. The scale’s overnight swings are doing all the work; the filter is doing all the ignoring.

What alpha equals a 7-day moving average? 0.25, by α = 2 / (N + 1)

Exponential decay has several interchangeable parameters: α = 1 / (1 + c) where c is the center of mass, α = 2 / (span + 1), and α = 1 − exp(−ln2 / halflife). An N-day SMA weights lags 0 through N−1 equally, so its center of mass is (N−1)/2. Set the two centers of mass equal and the rule falls out:

(N − 1)/2 = (1 − α)/α → α = 2 / (N + 1)
SMA windowEquivalent αCenter of massHalf-life of one weigh-in
5 days0.3332.0 days1.7 days
7 days (the app’s smaWindow default)0.2503.0 days2.4 days
10 days0.1824.5 days3.5 days
14 days0.1336.5 days4.8 days
19 days0.100 (the app’s ewmaAlpha default)9.0 days6.6 days
21 days0.09110.0 days7.3 days

The app ships a 7-day window and an alpha of 0.10 as two separate defaults, and by this rule they describe two different filters. Alpha 0.10 answers to a 19-day window. If you switch from SMA to EWMA and leave both parameters alone, you have roughly tripled the memory of the line, which is most of why it stopped moving. Set alpha to 0.25 and you are asking the EWMA for the same average data age the SMA had.

Where does that rule of thumb stop being useful?

It equates exactly one property — average data age — and stays silent on everything else. Three places that matters:

Noise rejection does not follow. By the rule, alpha 0.10 is a 19-day filter and ought to reject far more of the scale’s daily movement than a 7-day SMA. On this user’s log it rejects 75.9% against the SMA’s 74.7%. Just over a percentage point, at nearly triple the memory.

The two lines are not fed the same series. SMA never interpolates missing days; the EWMA follows the app’s global interpolation setting, which is on by default. This user’s log has 84 weigh-ins spread across 225 days, so that setting decides whether the filter sees 84 points or 226. Interpolation changes the line more than most people expect, and here is the measurement: Hacker’s Diet is the same EWMA recurrence with alpha pinned at 0.1 and interpolation forced off, and it moves 0.229 lb per point while ignoring 80.3%. Same formula, same alpha, gap filling turned off — more than twice the movement. Thirty-five years on, that filter still holds up, and it is the honest like-for-like against the SMA: on a series that skips missing days, alpha 0.1 moves 0.229 lb against the SMA’s 0.295 and ignores 80.3% against 74.7%. Less movement and more rejection, at more lag. There is no measured EWMA-at-0.25 row to quote, so the matched-lag comparison stays an open question rather than a claim.

Neither one resists an outlier. Both filters take a 5 lb morning at face value and simply spread it over different numbers of days. If that is the failure mode you care about, the fix is a different family of method — a rolling median throws the bad reading out rather than averaging it in, and the app’s default Robust Adaptive EWMA down-weights it using a MAD estimate of the residuals.

What changes when you switch from SMA to EWMA?

MethodLine moves per pointScale movement ignoredFinal reading
SMA, 7-day window0.295 lb74.7%184.7 lb
Rolling Median, 7-day window0.304 lb73.9%185.0 lb
Hacker’s Diet (α 0.1, no interpolation)0.229 lb80.3%186.0 lb
EWMA (α 0.10, interpolation on)0.103 lb75.9%184.5 lb
Robust Adaptive EWMA (default)0.094 lb78.1%185.0 lb

All five ran on the same file and finished 1.5 lb apart. Across all fifteen methods the spread is 4.0 lb. Read any one of those final numbers against that spread before you take it as the truth about your body. Signal and noise on a bathroom scale sets out how much of it is unavoidable.

Two practical notes. Both smaWindow and ewmaAlpha are editable, but SMA and EWMA appear only with Advanced Mode switched on, and Advanced Mode and the parameter editor are both Pro; Simple Mode offers four methods and neither of these is among them. And whichever of these two you pick, the weekly rate printed beside it is computed the same way — trend[i] − trend[i−7], a seven-index look-back on the trend line itself, not a regression. Change the method and the rate changes with it.

If the SMA’s movement is the thing bothering you and you would rather not pay for it in lag, the double-exponential methods attack it from the other end. DEMA and TEMA subtract the lag back out instead of lengthening the memory. Choosing a trend method walks the whole decision, and the methods page sets out all fifteen with the mathematics as implemented.

Peptrend's Trend Settings screen with Advanced Mode switched on, listing the trend methods with a visibility eye beside each one.
SMA and EWMA only appear once Advanced Mode is on, and Advanced Mode is Pro.

Common questions

What alpha is equivalent to a 7-day simple moving average?

0.25, by the rule alpha = 2 / (N + 1). It matches the two filters on average data age: an N-day SMA averages data (N−1)/2 days old, and an EWMA at alpha averages data (1−alpha)/alpha days old. A 7-day window and alpha 0.25 both sit 3 days back.

Does an EWMA lag more than a simple moving average?

Not at a matched alpha — by construction the two carry the same average data age. At Peptrend's shipped defaults it does: the 7-day SMA sits 3 days back and the EWMA at alpha 0.10 sits 9 days back, because 0.10 answers to a 19-day window, not a 7-day one.

Why does my SMA line move on a day my weight barely changed?

Because a 7-day SMA's step is (today's weigh-in minus the weigh-in that just left the window) divided by 7. A quiet reading today still moves the line if the value dropping off the back was an unusual one.

How far behind my weigh-ins is the trend line?

At the shipped defaults, 3 days for the 7-day SMA and 9 days for the EWMA at alpha 0.10, measured as the average age of the data behind today's point. The rule connecting the two is alpha = 2 / (N + 1).

Sources