One journal instead of scattered notes
Tedd’mhen grew out of wanting to understand my own training. When an injury led me to examine load and recovery more closely, I needed somewhere to connect measurements with everyday observations. A running result or a weight on the bar left sleep, well-being and the preceding days out of the picture.
In my own training, I wanted to revisit a particular day and compare the effort with subsequent sleep and well-being. That led to a single daily record and analysis with calendar lags: Monday’s training can be paired with sleep recorded on Tuesday.
Measurements, training sessions, habits and notes share one place. Custom activities and saved form layouts let the journal fit what I’m currently tracking.
Why a one-day lag matters
One of the most important decisions was assigning sleep to the waking date. Sleep recorded on Tuesday therefore describes the night after Monday’s training. Pairing training and sleep from the same date would often reverse the order: I would be looking at the night before a session rather than the night after it.
In the code, a lag means calendar days, not adjacent table rows. An observation pair for input variable and outcome is formed only when both calendar dates exist and pass active filters:
where and are the sets of dates with valid measurements passing the active filters. If I missed Tuesday’s record, Wednesday does not automatically become “the next day” for Monday (). That detail determines whether the analysis addresses the temporal relationship I meant to ask about. Missing measurements and dates excluded by filters remain gaps.
Working with observations
The journal filters observations by dates, text, training type and illness context. Unusual values require explicit confirmation before saving. Missing measurements remain missing rather than becoming zero.
Views include Pearson and Spearman correlations, detrended relationships, and means over complete 7- and 28-day windows. These show both individual days and changes over longer periods.
Longer histories introduce another trap: two measurements can move together simply because both share a trend over time . Rising mileage alongside improving fitness across a multi-month macrocycle, for example, does not yet explain how well-being responds to a single harder day. Detrending asks a narrower question: after subtracting ordinary-least-squares linear trends, are the residuals of the two variables:
still associated? Here and are already aligned series, measures elapsed calendar days, and and are the fitted intercept and slope. I fit both trends on the shared set of pairs, preserving the gaps between dates. That is why the tool offers raw levels, day-to-day changes and detrended values side by side.
Models with visible uncertainty
Bayesian models describe a single-variable trend or estimate one outcome from several inputs. Computation normalizes the outcome to , where and are the fixed center and scale for that metric. For design matrix (including an intercept column), I use a Gaussian linear model with a conjugate Normal–Inverse-Gamma prior:
The vector contains regression coefficients, is the residual variance, and is the identity matrix. specifies the center of the coefficient distribution, the positive-definite matrix its conditional precision up to the scale, and and the inverse-gamma shape and scale. I use the density convention proportional to . In the application, , , ; the diagonal matrix reflects the selected regularization strength. By conjugacy, after incorporating observations the posterior retains the same form:
The symbol denotes transposition. The implementation computes through an equivalent sum of squared residuals and a regularization term, reducing precision loss from subtracting large, nearly equal numbers.
Integrating out the unknown variance yields Student- coefficient marginals and predictive distributions with degrees of freedom. For a new feature vector , the squared scale parameters for the mean response and an individual observation are respectively:
The extra one accounts for noise in a new observation. Charts show both intervals separately, converted back to the original outcome units: the narrower band shows uncertainty in the mean trend itself, while the wider band shows the plausible range for a single new day’s reading. Exploratory forecasts extend up to 28 days, with chronological evaluation against later observations.
This is observational analysis. Correlation does not establish a cause, and intervals depend on the model assumptions and the quality of recorded data. The methodology documentation explains equations, calendar alignment and limitations.
Calculations that leave the interface responsive
The application separates two different jobs. Cloudflare Workers and D1 handle storing and retrieving the journal. A browser Web Worker receives observations and analysis settings, then returns results to the React interface. These are two separate execution environments.
Fitting a model and calculating relationships therefore leave the main interface thread available. Changing the date range or analysis settings terminates the previous worker. An older result cannot overwrite the chart for a newer selection. Calculations receive lightweight measurement records; long-form notes stay outside this path.
Because the posterior precision matrix is symmetric positive-definite thanks to the positive-definite prior precision , multivariable linear systems are solved in the Web Worker via Cholesky factorization (). is lower triangular; I solve successive triangular systems instead of explicitly inverting the whole matrix. Conjugacy supplies the posterior analytically, without Markov Chain Monte Carlo (MCMC) sampling. This choice makes the calculation fast, deterministic and traceable through code and documentation, with explicit assumptions about linearity and model residuals.
Your data and an open workshop
I also wanted to be able to revisit my records outside the application. Imports can be inspected before saving, and exports move the data into another tool. Model reports retain inputs, settings and distribution parameters so that a particular analysis can be reproduced.
The public demo uses synthetic data. You can explore the journal and analysis without creating an account; demo edits are temporary. The repository contains source, tests and architecture notes, with full documentation on GitHub Pages.