Every day, our Apple Watches and iPhones quietly collect millions of data points about our bodies. We track sleep, log meals, record workouts, measure heart rates, and count our steps.
Apple’s native Health app is great for collecting all this data in one place. But when it comes to the question: “How does one habit affect another?” – we hit a wall.
Does eating higher sodium cause a next-day spike in water retention? Does hitting 10,000 steps consistently improve your Heart Rate Variability (HRV)? Does a late dinner elevate your resting heart rate while you sleep?
Historically, answering questions like these meant exporting raw .xml archives, firing up Python or Excel, and manually crunching numbers. I wanted a way to do that instantly, right from my phone.
That’s why I’m building Correlate – an iOS app that uncovers hidden statistical connections across your health data.
Breaking Down the Silos
Health metrics don’t live in isolation. Your heart rate is influenced by your workouts, your workouts are fueled by your nutrition, and your recovery is reflected in your sleep and vitals.
Yet most health apps treat them as isolated silos: activity lives on one tab, nutrition on another, vitals somewhere else.
Correlate bridges these silos by letting math reveal how your habits and biomarkers actually interact.


Insights and Correlate tab screenshots.
What I’ve Built So Far
Building Correlate from scratch in Swift and SwiftUI, I focused on creating an automated engine centered on statistical time-series analysis and clean visualizations:
1. Comprehensive HealthKit Integration
The app plugs directly into Apple’s HealthKit API, querying and normalizing historical data across 25+ streams spanning five core categories:
- Activity & Mobility: Daily Steps, Active Energy, Basal Burn, Walking Distance, Flights Climbed, Exercise Time, Walking Speed, and Walking Asymmetry.
- Nutrition: Calories, Protein, Carbohydrates, Total Fat, Fiber, Sugar, Sodium, Water, and Caffeine.
- Vitals & Heart: Heart Rate, Resting Heart Rate, Walking Heart Rate, HRV, Blood Oxygen, Respiratory Rate, and Sleeping Wrist Temperature.
- Body Measurements: Body Mass (Weight), BMI, Body Fat %, Lean Body Mass, and Waist Circumference.
- Sleep & Mindfulness: Sleep stages (Core, Deep, REM duration) and Mindful Minutes.
2. Synthesized Linear Combinations
Human metabolism is driven by net interactions rather than isolated numbers. Correlate dynamically synthesizes multi-metric composite equations:
- Net Caloric Balance & Deficit: Accurately balances dietary calories against Total Daily Energy Expenditure, giving an authentic view of energy balance.
- Net Carbohydrates: Subtracts indigestible dietary fiber from total carbohydrates to isolate blood-glucose impact.
- Heart Rate Exertion Delta: Calculates the spread between walking heart rate and baseline resting heart rate to measure cardiovascular conditioning and daily autonomic stress.
3. Rates of Change (Derivatives)
Static metrics miss the momentum of your physiology. Looking at absolute body weight on a single day doesn’t tell you much because water and glycogen fluctuate constantly. What actually matters is your velocity.
Correlate calculates first numerical derivatives—both 1-Day and 7-Day changes. Because people don’t step on a scale every single day, the engine applies linear interpolation across intermittent weigh-ins. This connects daily nutrition logs with multi-day body mass velocities seamlessly across months of real-world tracking.
4. Time-Lagged Features
Cause and effect in biology are rarely simultaneous. What you eat or how hard you train in the evening doesn’t just affect today; it affects your resting heart rate and recovery tomorrow.
Correlate supports temporal shifting (1, 2, 3 and 7 days) to quantify delayed biological reactions—like pairing yesterday’s sleep duration directly against today’s HRV or resting heart rate.
5. Automated Insights & Local Persistence
Instead of making users manually guess which two variables to correlate, Correlate features an automated discovery engine on the Insights tab:
- It scans the Cartesian product of all active raw metrics, linear combinations, derivatives, and lagged features.
- It calculates Pearson correlation coefficients and evaluates sample sizes.
- It automatically prunes trivial tautologies (like Steps vs. Distance, or Weight vs. BMI) so only genuine physiological discoveries rise to the top.
- It features dedicated interpretations for Body Mass Velocity, distinguishing short-term fluid/glycogen shifts from sustained caloric energy balance.
- Discoveries are encoded and cached to disk locally, so your insights load instantaneously every time you open the app without re-scanning.
6. Search, Filtering, and Responsive Charts
To make exploring relationships effortless:
- Instant Search & Autocomplete: Search for any metric or pick a specific feature transform (e.g. Body Mass 7-Day Change or Calorie Deficit) to filter comparisons strictly to that feature.
- Independent Feature Toggles: Three independent switches let you freely mix or isolate Raw Features, Rates of Change, and Lagged Features.
- One-Tap Axis Inversion: A “Swap X & Y” toggle in both the custom correlation lab and the insight detail views inverts independent and dependent variables, regression slopes, and axes on demand.
- Fitted Swift Charts: Single-metric trends and bivariate scatter plots with best-fit linear regression lines automatically scale to the observed data domain rather than forcing an artificial zero baseline.
Data Privacy First
Health data is deeply personal. Correlate processes every calculation, linear interpolation, and statistical regression entirely on-device. No cloud databases, no analytics trackers, and no third-party data sharing – this remains non-negotiable.
What’s Next?
While the core statistical and automated discovery tools are working well, there’s still plenty to do:
- Multi-Variable Regression: Isolate confounding factors – for example, controlling for workout intensity when examining the relationship between sleep duration and next-day resting heart rate.
- Rolling Correlation Windows: Track how correlations change over time (e.g., whether the link between your caffeine intake and sleep quality weakens or strengthens during different seasons or training blocks).
- Automated Digest: Generate a periodic health brief highlighting newly emerged behavioral patterns over the trailing 30 days.
Final Thoughts
We are living in an era where we have more personal biometric data than any generation before us, but it is still troublesome to turn that data into genuine self-understanding.
Building this app has been an exciting journey of bridging mobile development, statistics, and personal wellness. I’m excited to refine it further and get it into the hands of testers soon!