What the pattern engine is
The part of Tend that looks for patterns is a short, fixed list of rules. It is deterministic: the same record always produces the same words. It runs on your device, using your record and nothing else. It is not machine learning. Nothing is trained, nothing learns from other people, and no model decides what to look for.
It has two branches. Branch A compares pairs of things across days. Branch B counts what came before your recorded flares. Each branch has a floor, and below its floor it shows nothing at all.
Branch A: four fixed comparisons
Tend does not search your record for anything that happens to line up. It checks exactly four pairings, and each pairing has fixed lags. A lag of 0 means the same day. A lag of 1 means the first thing on one day and the second thing the next day.
| Comparison | First thing | Second thing | Lags tested |
|---|---|---|---|
| Sleep and pain | Sleep quality from your check-in | Pain rating | 0 and 1 days |
| Steps and pain | Step count, from Health if connected | Pain rating | 1 and 2 days |
| Weather score and pain | Tend's daily weather score, if weather is turned on | Pain rating | 0 and 1 days |
| Overnight reading and fog | The overnight Apple Watch reading, if connected | Brain fog rating | 0 and 1 days |
The sleep check-in asks about last night, so a lag of 0 already spans a night. Steps use lags of 1 and 2 days because the question being tested is whether pain follows a busy day, not whether it happens on one. Where the first thing depends on an optional connection you have not made, that comparison has no pairs and stays silent.
The list is capped in code at six pairings per release. Four are used today.
The 14-paired-day floor and missing answers
A paired day is a day where both things in a comparison were answered, at the lag being tested. For sleep and pain at lag 1, that is a sleep answer on one day and a pain answer the next day. A comparison needs at least 14 paired days before Tend computes anything for it.
A skipped answer stays missing. It is never treated as zero, and it never counts as a paired day. At lag 0, sixteen days with two gaps is fourteen pairs, not sixteen, and if a third gap appeared the comparison would fall below the floor and go quiet. At lag 1 the same gaps cost more, because one gap can break two consecutive-day pairs.
Why 14
Fourteen is the floor written into the code, not a guarantee. Below it Tend computes nothing. At or above it, a word is only as good as the record behind it, and more days can change or remove a result. That is why the count is always shown beside the word.
The rank correlation and the 500 shuffles
With 14 or more pairs, Tend ranks each side from lowest to highest, with tied values sharing an average rank, and computes Spearman’s rank correlation, written rho. It runs from -1 to 1. Near zero means the two orderings do not line up. Ranks are used rather than raw values so that one extreme day cannot dominate.
Then Tend asks how easily that number could appear by chance. It shuffles the second column 500 times, recomputes rho each time, and counts how many shuffles came out at least as strong as the real one. The result, p, is that count plus one, divided by 501.
The shuffles are fixed. The random order comes from a seed set per comparison and per lag, never from the clock or the data, so the same record gives the same count every time it is opened. Two people with identical records would see identical words.
A comparison with two lags is tested at both. The stronger word wins. On a tie, the larger |rho| wins, then the shorter lag. Size, not direction: a rho of -0.5 beats one of 0.4.
Three exact words, and silence
Tend never shows rho or p. It shows one of three phrases, chosen by exact thresholds. Below the weakest threshold it shows nothing.
|rho| ≥ 0.45 and p < 0.02|rho| ≥ 0.35 and p < 0.05|rho| ≥ 0.25 and p < 0.10anything weakerEach phrase sits next to a fixed sentence and its denominator. The sentence is chosen from a short list, has no digits, and describes timing only: which ratings were higher or lower, and after what. The denominator is the count of paired days, always shown.
Pain ratings were higher one day after high-step days.
a pattern forming · 23 paired days
“Silence” means the card is empty. A comparison whose thresholds are not met stays silent, however long the record. Tend does not write “no pattern found” in its place. The one exception, the weather view’s settled result, is described under the weather caption below.
A worked example: 14 pairs
Made-up days, the engine’s own arithmetic. Sixteen days of the sleep and pain comparison at lag 0. Day 5 has a sleep answer but no pain answer. Day 12 has no check-in. That leaves 14 pairs, exactly the floor.
- Rank the 14 sleep values and the 14 pain values separately. Ties share an average rank.
- Compute Spearman’s rho on the ranks. Here it is
-0.494: better sleep sits with lower pain, fairly strongly for such a short run. - Shuffle the pain column 500 times with the fixed seed, and count shuffles at least as strong as
0.494. 33 of them are. Thenp = (33 + 1) / 501 = 0.068. - Apply the bands. The size clears the top threshold, but
p = 0.068clears only the weakest. The word is an early hint.
The card would show:
Pain ratings were higher after short sleep.
an early hint · 14 paired days
That is the point of the example. A correlation that looks strong on fourteen days earns the weakest word, because fourteen days of a scale from 0 to 10 can line up by chance more often than it looks. A longer record with the same ordering would give the shuffle test more to work with, and the word could change in either direction. One more gap, and the card would be empty.
Branch B: what came before your flares
Branch B is a count, not a correlation. It needs at least 3 recorded flares. Below that it reports nothing. For each flare it looks at whole days around the day the flare started, and asks whether each of five factors was present. The windows are calendar days, not a rolling clock: a flare at breakfast and a flare at midnight on the same date read the same two days.
| Factor | What counts | Window before the flare |
|---|---|---|
| Short sleep | Sleep quality below your own lower quarter | The onset day and the day before |
| High step count | Steps above your own upper quarter, if Health is connected | The two days before |
| Higher weather score | Tend's daily weather score above your own upper quarter, if weather is on | The onset day or the day before |
| High overnight reading | The overnight Watch reading above your own upper quarter, if connected | The two days before |
| Elevated resting heart rate | Resting heart rate above your own upper quarter, if Health is connected | The onset day or the day before |
“Your own upper quarter” means the 75th percentile of your own answered history, and the lower quarter is your 25th. There is no population cutoff anywhere in this branch. A factor you never record has no threshold and never counts. With very few answers the quarter marks sit at the extremes, so the factor fails quietly rather than firing on thin data.
The result is a precursor fraction per factor, in the sentence the app prints. The numbers are required here: they are the denominator.
3 of your 4 flares followed a short-sleep night.
the whole finding, as shown
A factor that came before none of your flares is not listed. Factors are ordered by fraction. That fraction says how often a factor was present before a flare in your record. It does not say the factor caused the flare, and it does not say the next such night will be followed by one.
Three other things Tend says, and how they differ
Not every line in Tend comes from the two branches above. Three others have their own rules, and it matters not to confuse them with a correlation or a precursor fraction.
7-day captions
A chart of one rating over time may carry a caption such as Ratings improved lately, Ratings worsened lately or Ratings stayed about the same. This is a straight line fitted through the visible days, and it needs at least 7 answered days. It says the line moved by at least one point on the 0 to 10 scale across that span, or that it did not. It compares nothing with anything else. It is a description of one rating’s recent direction, not a pattern.
The weather caption
The weather view may say which of three symptom levels most of the recorded days fell into. It also needs 7 recorded days. It is a tally, not a test, and it says nothing about the weather’s effect.
The same view reads its verdict straight from the weather score and pain comparison above. If that comparison has earned no word after 104 paired days, the view reports a settled result: no pattern between the weather score and pain in your record so far. That is the only place Tend says so, and only for weather. Every other comparison simply stays silent when its thresholds are not met.
The 21-night overnight reading
With an Apple Watch connected, Tend summarises each night’s heart rhythm and sleeping heart rate and compares the newest night with your own earlier nights. It needs 21 baseline nights before it will say Lighter than usual, Near your usual or Higher than usual, and the count of baseline nights is shown beside the words. No population range is used. If the two signals disagree, or if the day before was one of your own unusually active days and movement could explain the reading, Tend withholds the word and says why. This reading is about one night against your own baseline. It is not a correlation with any symptom.
Optional connected data
Your record is your check-ins and flares. Three optional connections add to it, and each is off until you turn it on.
- Health. Steps and resting heart rate, read from Apple Health on your device. They feed the steps comparison and two of the flare factors.
- Weather.Tend’s daily weather score, one number per day that combines pressure, its trend, humidity and temperature from local weather readings. It feeds the weather score comparison and one flare factor. Your record keeps the score and the four contributions it was worked out from, each one an offset from a fixed baseline rather than a reading. The provider’s own forecast values stay in a working cache for the weather view, are not written to your record or carried into an export, and are cleared when you turn weather off. Tend does not read raw pressure on its own.
- Apple Watch overnight. The overnight reading, which feeds the fog comparison, one flare factor, and the 21-night reading.
With a connection off, every rule that needs it has no pairs and stays silent. Nothing is estimated in its place. The privacy policy says what each connection shares and with whom.
What these rules cannot tell you
Everything above describes association: which of your ratings were higher or lower, after what, and how often something was present before a flare. That is all a record of answered days can support, and it is all Tend says.
- Not cause. Pain ratings being higher after short sleep does not mean short sleep caused the pain. Both could follow a third thing, or the order could be the other way round.
- Not prediction. A precursor fraction counts the past. It does not say a flare is coming. Tend forecasts no flare and no symptom; the weather view shows a weather forecast, and that is the only forecast in the app.
- Not diagnosis or treatment. Nothing here tells you what you have or what to do about it. It may give you something specific to discuss with your own doctor.
- Not a general statement.Every word rests on one person’s record. A pattern in your days says nothing about anyone else’s, and this page makes no claim about what sleep, steps, weather or overnight readings do to people in general.
The floors are floors. Fourteen paired days, three flares and twenty-one nights are the least Tend will speak on, not the amount at which its words become certain. The rules do not change as your record grows: the same four comparisons, the same cap of six, the same thresholds. What travels with every word is the count it was computed from.
Where these facts come from
This page describes the pattern engine in Tend 1.0.3, read from its source and its tests. The thresholds are constants in that code, not settings, and the tests hold them at the values above. When a threshold or a rule changes, this page is updated and its date changes with it.
It covers the readings named on this page and no others. The engine has further rules behind screens this page does not describe, each with thresholds of its own, and they are not listed here.
The editorial policy sets the rules this page is written to. To report a mistake, use the address at the bottom of the page.