$$ % Define your custom commands here \newcommand{\bmat}[1]{\begin{bmatrix}#1\end{bmatrix}} \newcommand{\E}{\mathbb{E}} \newcommand{\P}{\mathbb{P}} \newcommand{\S}{\mathbb{S}} \newcommand{\R}{\mathbb{R}} \newcommand{\S}{\mathbb{S}} \newcommand{\norm}[2]{\|{#1}\|_{{}_{#2}}} \newcommand{\pd}[2]{\frac{\partial #1}{\partial #2}} \newcommand{\pdd}[2]{\frac{\partial^2 #1}{\partial #2^2}} \newcommand{\vectornorm}[1]{\left|\left|#1\right|\right|} \newcommand{\abs}[1]{\left|{#1}\right|} \newcommand{\mbf}[1]{\mathbf{#1}} \newcommand{\mc}[1]{\mathcal{#1}} \newcommand{\bm}[1]{\boldsymbol{#1}} \newcommand{\nicefrac}[2]{{}^{#1}\!/_{\!#2}} \newcommand{\argmin}{\operatorname*{arg\,min}} \newcommand{\argmax}{\operatorname*{arg\,max}} \newcommand{\dd}{\operatorname{d}\!} $$

API reference

Configuration and data

The subject file, the observations CSV and its validation, and the daily bookkeeping.

config Subject metadata, goals, and safety limits.
schema CSV column definitions and validation.
io Loading observations from CSV into episode arrays.
daily The morning routine’s bookkeeping: record today’s readings, keep a plan log.
constants Physiological and unit constants, with provenance.

The model

State and parameter types, the physiology, the step map, the observations.

models.types Core datatypes: model state, parameters, and daily inputs.
models.energetics Energy expenditure: resting metabolism, the thermic effect of food, and
models.partition Body-composition partitioning: how much of a mass change is fat.
models.glycogen Fast water compartments: glycogen-bound and sodium-associated water.
models.dynamics The continuous-time model, its one-day step map, and the process-noise model.
models.observation The observation model: what a bathroom scale actually reports.

Filters

Model-agnostic Kalman, unscented and extended filters and smoothers.

filters.common Shared filter types and numerical helpers.
filters.linear Linear Kalman filter, RTS smoother, and the local-linear-trend model.
filters.ukf Unscented (sigma-point) Kalman filter and smoother.
filters.ekf Extended Kalman filter using JAX automatic differentiation.

Estimation

Phase 1 noise identification, phase 2 joint estimation, reparameterization, the backtest.

estimation.noise_id Phase 1: identifying the noise scales from weight-only history.
estimation.joint Phase 2: joint estimation of physiological state and metabolic parameters.
estimation.reparam Constrained/unconstrained parameter transforms.
estimation.backtest Out-of-sample check: how well does the fitted model forecast the scale?

Control

Cost terms and the receding-horizon controller.

control.objectives Cost functions for the model-predictive controller.
control.mpc Receding-horizon dietary control.

Exercise energy

MET estimates from a routine CSV or a dated workout spreadsheet.

routine A minimal, current-state definition of a lifting routine.
exercise Estimating exercise energy expenditure from a logged lifting session.
tracker_write Appending a repeated session to the workout tracker spreadsheet.

Synthetic data, figures and the command line

synthetic Synthetic data generation, for testing and for calibrating expectations.
viz Diagnostic figures.
cli Command-line interface.