On-device analysis
Matched-pair statistics
Sleep quality drivers
Feast Sleep Analysis
Feast is the only nutrition tracker that runs statistical analysis between food intake
and sleep quality, so you can see exactly how caffeine, alcohol, and meal timing affect
your recovery.
What Feast measures
- Caffeine residual at bedtime
- Alcohol residual at bedtime
- Calories and glycemic load in the 3 hours before sleep
- Last meal gap and feeding window length
- Nightly sleep score and standardized z-score
What the analysis is
Feast runs an on-device, N-of-1 sleep analysis pipeline that quantifies how your
evening nutrition influences your sleep. Instead of comparing you to population averages,
Feast compares your high-exposure nights to your own baseline nights that look similar
in schedule and context.
Feast is the only app that performs matched-pair statistical analysis between meal timing,
caffeine, alcohol, and sleep quality.
Sleep score construction
Feast builds a nightly sleep score in two layers. If Apple provides a sleep score, Feast uses it
directly. Otherwise, Feast computes a composite score using efficiency, REM percent, deep percent,
total sleep time (TST), and wake after sleep onset (WASO).
The composite uses weighted components: efficiency (0.45), REM (0.20), deep (0.20),
z-scored TST (0.15), and z-scored WASO (0.10). Each night is standardized using a rolling
median and median absolute deviation, producing a z-score aligned to your own baseline.
Exposure modeling
Feast derives multiple exposure variables for each night:
- Caffeine residual at bedtime: exponential decay using a personalized half-life (3-7 hours).
- Alcohol residual at bedtime: grams remaining using a 7 g/hour elimination model.
- Late calories: calories eaten within 60, 120, and 180 minutes of bedtime.
- Glycemic load proxy: sugars plus 0.5 times other carbs within 3 hours of bedtime.
- Last meal gap: minutes between bedtime and the last meal over 70 kcal.
- Fasting day flag: day-level intake below 400 kcal.
- Negative control: calories 8-11 hours before bed to detect spurious correlations.
Caffeine half-life is personalized by testing a 3-7 hour grid and validating on a holdout
window. If the signal is weak, Feast defaults to 5 hours.
Matched-night design and controls
- High-exposure nights are defined by top-quantile thresholds per factor.
- Baseline nights are matched within plus/minus 60 days, same weekday, and within 90 minutes of bedtime.
- Prior-night scores are used to reduce carryover effects.
- Each baseline night has limited reuse to avoid bias.
- Confounding combinations are screened out so each factor is evaluated cleanly.
Statistics and outputs
- Weighted median delta: winsorized paired differences with recency weighting.
- 95% confidence interval: 400-resample bootstrap on matched pairs.
- Permutation p-value: 2000-resample random sign test.
- Multiple testing control: Benjamini-Hochberg q-values.
- Effect size: probability of superiority and Cliff's delta.
- Trend slope: per-unit change in sleep z-score.
- Dose-response strip: 5 exposure bins with mean z and 95% CI.
The Sleep Quality card visualizes these results with a timeline of hit nights,
dose-response bars, and a stats row that includes sample size and confidence intervals.
Unlock requirements
- At least 15 meal days logged in the analysis window.
- At least 3 high-exposure nights per factor.
- Apple Health sleep access enabled and synced.
- Feast Pro subscription to view the full sleep coaching card.