How Weight Trend Lines Are Calculated: Moving Averages, EMA and Missing Data

A developer explains that weight trend lines smooth noisy daily scale readings, with users asking whether the figure is a 10-day or 3-week average. The article compares a simple moving average, an exponential moving average popularized by The Hacker's Diet, and Holt double exponential smoothing. It walks through each method's tradeoffs, including how simple averages react twice to one unusual weigh-in and how EMA lags during real change. The author also presents a dependency-free JavaScript module that handles missing days, units, time zones and rounding, tested against synthetic data.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.


Discussion (0)
Log in to join the discussion and vote.
Log in