Each night is standardized against its own prior baseline. Spread is the larger of 1.4826 × median absolute deviation and a metric-specific floor. Scores are oriented so positive means the better direction, then clipped to ±3.5.
d = mean(z with) − mean(z without)
se² = variance(with) / n with + variance(without) / n without
shrunk = d × τ² / (τ² + se²), with τ = 0.35
shrunkSE = √(τ² × se² / (τ² + se²))
P(direction) = Φ(|shrunk| / shrunkSE)Each group’s variance has a floor of 0.5. Possible requires |shrunk| ≥ 0.30 and P ≥ 0.975. The statistical bar for Likely is |shrunk| ≥ 0.45 and P ≥ 0.995, plus the sample, history and overlap requirements above. These probabilities describe the model’s direction confidence; they are not the probability that a food caused the outcome.
The engine tests five habits against four metrics: 20 comparisons. In the repository’s simulated 30-night calibration, about 9.7% of noise-only histories (58 of 600) produced at least one finding across all 20 comparisons. That is a simulation result, not a measured real-world error rate or a clinical validation.
Baseline spread floors: time to sleep 5 min; HRV 8 ms; resting HR 1 bpm; total sleep 15 min. Sleep efficiency is shown in the morning read but is not a pattern-test outcome.