In this post, we will try to infer my weight from a sequence of noisy measurements. The measurements have been entered by myself in the Google Fit app over the course of a couple of years.
The most straight-forward approach to this problem would be to simply lowpass filter the measurements, which we try below. However, weight measurements are affected by a large number of error sources; varying hydration level -- Weight will vary depending on the amount of liquid consumed prior to weighing, the amount of glucogen stored in the muscles (1g of glycogen binds ~3g of water) and therefore the amount of carbohydrates consumed prior to weighing and the creatine levels in the muscles etc. Some of these error sources are reasonably well modeled by Gaussian noise, but some aren't. A large meal or beverage consumed prior to weighing, for instance, creates a large positive noise term. We therefore build a noise model that is a sum of a Gaussian term and an exponential term, and try to infer not only the weight, but also the exponential disturbances. To this end we employ a particle smoother.