circadian
Estimate your body clock's preferred wake time and bedtime from Garmin sleep history, and test the estimate against your own Garmin scores.
Instructions
Estimate when this user's body clock wants them to wake up, and test that estimate against their own Garmin history. Read-only: analyses synced sleep times locally and changes nothing.
Use for "am I a morning person?", "what time should I wake up?" or "what bedtime fits me?". For whether a single night or metric was normal, use baselines or get_day; for a relationship between two metrics, correlate.
Returns three separate estimates, each with an 80% interval: chronotype (MCTQ MSFsc, mid-sleep on free days corrected for catch-up sleep), sleep need, and an inferred wake window with bedtime. Also: stability across reasonable settings, and evidence from a rolling holdout on whether waking near the window went with higher Garmin scores beyond sleep duration and regularity (consistent / supportive / suggestive / unsupported; these describe consistency on unseen nights, not statistical significance), plus a plain-language interpretation and notes. Needs 28+ nights with sleep times; evidence needs 180+ days of history. Takes well under a second.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| end | No | Last wake date, YYYY-MM-DD. Default: yesterday. | |
| start | No | First wake date, YYYY-MM-DD. Default: 180 days before end. | |
| detail | No | Add the wake-time bins, the sensitivity grid, per-fold model errors and bootstrap diagnostics (output up to about 6 KB). | |
| outcome | No | Garmin score to test against: readiness_score, sleep_score or body_battery_high. Default: readiness_score, else sleep_score. | |
| free_days | No | Weekdays whose mornings are alarm-free, as mon..sun. Default ["sat", "sun"]; use e.g. ["fri", "sat"] for a Friday-Saturday weekend. | |
| sleep_need_min | No | Your sleep need in minutes of time in bed, 240 to 720 (e.g. 480 for 8 h). Overrides the estimate from free-night sleep; useful when weekends are spent catching up. |