Analyze trend (advanced)
analyze_trendAnalyze a health signal's trend with slope and confidence interval, baseline comparison, rate of change, outlier detection, model fit assessment, and change-point identification.
Instructions
Trend intelligence for one signal — beyond a single straight line.
Pulls a signal's dated numeric readings and returns, in one call:
trend — least-squares slope with a standard error, 95% CI, p-value, and an honest 'distinguishable from flat / treat as noise' verdict;
baseline — the latest reading framed against your own recent median and typical range (Q1-Q3), the way a clinician reads a value;
rate_of_change — recent vs earlier slope, exposing acceleration;
outliers — points flagged by a robust median/MAD z-score, not silently averaged into the mean;
shape — whether a straight line is the right model at all (weak fit, residual runs, or a better-fitting quadratic) and whether linear extrapolation is advisable for bounded or cyclical signals;
change_point — the single most likely regime shift, if any.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | the signal name, e.g. 'weight_kg', 'a1c_percent', 'resting_heart_rate'. | |
| user | No | which person; defaults to the primary user. | |
| since | No | ||
| until | No | ||
| source | No | 'metric' | 'wearable' | 'lab' | 'biomarker' | 'substance'. | metric |
| outlier_threshold | No | modified z-score cutoff for outliers (default 3.5). | |
| baseline_window_days | No | lookback for the baseline median/range (default 180). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||