How it works
No magic, just your cycles
Lunaison does not guess anything: it reads what you have logged, applies a few simple, public rules, and always shows you the uncertainty. Here they are.
The four stages of a cycle
A cycle starts on the first day of a period. The lengths below are an example: for most people, it is the first half that varies, while the second stays fairly stable at around 12 to 13 days.
How Lunaison estimates your next period
- Recognizing periods. A day with real bleeding starts a period; spotting alone does not. Up to two days without an entry in the middle do not split a period in two.
- Measuring your cycles. Each cycle runs from one first day of a period to the next. A gap of less than 15 days or more than 90 days is probably a missed entry: it is left out of the calculation.
- Taking the median of your last six cycles. The median is the middle value: an unusual cycle (stress, illness, travel) does not throw it off, unlike an average.
- Giving a range. Its width depends on how much your cycles vary: from 2 days either side if your cycles are very regular, up to 7 if they vary a lot. Without a history, it starts from what you entered at the beginning, with a 4-day margin.
- Estimating the phases. Ovulation is placed about 13 days before the next period, because this part of the cycle varies little. It is an estimate, not a measurement.
The "worth mentioning" alerts
When your notes move away from medical reference ranges, Lunaison points it out with a link to the relevant guide. It is never a diagnosis: just something to mention to a doctor, a gynecologist or a midwife.
| Alert | When it appears | Where the threshold comes from |
|---|---|---|
| Pain that stops your activities | "Severe" pain during at least 2 of your last 3 periods | ACOG 2018; threshold chosen by the app |
| Often heavy flow | 3 or more heavy days, during at least 2 of the last 3 periods | FIGO 2018; threshold chosen by the app |
| Long periods | More than 8 days, during one of the last 3 periods | FIGO 2018 |
| Cycles outside the usual range | Your last 2 cycles outside 24 to 38 days (21 to 45 under 18) | FIGO 2018, ACOG 2015 |
| Very variable cycles | More than 9 days' difference between your cycles, over at least 4 cycles (adults) | FIGO 2018 |
| No period for a long time | More than 90 days since the last period | ACOG 2015 |
| Bleeding between periods | At least 2 days of spotting outside periods, over the last 3 cycles | Threshold chosen by the app |
Where your data goes
Nowhere. Lunaison does not have permission to access the Internet: even by mistake, it could not send anything. The only way out is you.
Auditability: exact formulas and source code files
Lunaison embeds no artificial intelligence and no black-box model: every calculation relies on purely deterministic rules grouped in the core/cycle module with no Android dependency, and verified by automated unit tests on every build.
| Algorithm | Exact formula and constants | Source file and unit tests to audit |
|---|---|---|
| 1. Period detection | A period starts on the first day of real flow (LIGHT, MEDIUM or HEAVY; SPOTTING alone is excluded). Up to 2 unlogged days in between do not split a period (MAX_GAP_IN_PERIOD = 3). |
Periods.ktCycleConfig.kt |
| 2. Plausible cycle filtering & median | Only completed cycles lasting 15 to 90 days (MIN_PLAUSIBLE_CYCLE, MAX_PLAUSIBLE_CYCLE) are kept, over the last 6 cycles (CYCLES_FOR_PREDICTION = 6). Estimated length = integer median of kept cycles (or mean with declared baseline if only 1 cycle is logged). |
CycleAnalyzer.ktCycleAnalyzerTest.kt |
| 3. Forecast range width (uncertainty) | With 3 or more completed cycles: half-width spread = clamp(ceil(σ), 2, 7) days around the median date, where σ is the standard deviation of your last 6 cycles. With 2 cycles: ±3 days; without history: ±4 days (PROVISIONAL_SPREAD). |
CycleAnalyzer.kt |
| 4. Ovulation and cycle phases | Estimated ovulation at next_period - 13 days (LUTEAL_DAYS = 13), with a ±2-day ovulation window (OVULATION_WINDOW = 2). Estimate of the fertile window, from ovulation - 5 d to ovulation + 1 d. An estimate of the fertile window is available to adults who turn it on in the settings. It is off by default, never offered to anyone under 18, often wrong, and does not replace contraception. |
CycleAnalyzer.kt |
| 5. Symptom / phase correlation | A symptom or mood is linked to a phase only if it appears in at least 2 cycles (MIN_CYCLES_FOR_STATS = 2), in at least 50% of tracked cycles, and at least 2.0 times more frequently inside that phase than outside (PATTERN_ENRICHMENT = 2.0, once ≥ 5 days outside the phase are logged). |
PhasePatterns.ktCycleInsightsTest.kt |
| 6. Medical alerts (FIGO / ACOG / NHS) | Deterministic evaluation over the last 3 cycles (periods > 8 d, min/max spread > 9 d over at least 4 cycles, cycle outside 24..38 d or 21..45 d under 18, absence > 90 d, repeated severe pain or heavy flow in ≥ 2 of the last 3 periods). |
Alerts.kt |
| 7. Serverless partner sharing & update token | Single compact LUNA1:<base64url> string encoding only v1|firstName|sharedDate|usualLength|fertility|start1:len1,... for the last 6 periods (merged and deduplicated locally via PartnerSnapshot.mergeWith on every update). No personal notes, symptoms or moods are ever included. |
PartnerSnapshot.kt |