# 007. Observed reorder intervals

**Question:** What is the distribution of elapsed time between identified customers’ purchases?

## Result

The largest computed metric is 366 for maximum; the smallest is 0 for minimum. Metric: days (Days).

Only repeat purchasers contribute observed intervals. Right-censored intervals after the final purchase are absent.

![Observed reorder intervals](outputs/chart.png)

| statistic | days |
| --- | --- |
| minimum | 0 |
| p10 | 0.01181 |
| p25 | 6.845 |
| median | 21.92 |
| p75 | 51.04 |
| p90 | 103 |
| p99 | 252 |
| maximum | 366 |

The chart shows 8 of 8 result rows; the table previews the first 8 in the analysis-defined order. [Download the full result table](outputs/results.csv). Numerical values are computed from the source; missing results stay unavailable.

## Method

Distinct invoices, within-customer chronological differences and interval buckets.

The study uses shared source preparation and reusable statistical routines. Its specific transformations are in [analysis.py](analysis.py), and common model/evaluation code is in [portfolio/methods.py](../../portfolio/methods.py). The [notebook](analysis.ipynb) executes the study and displays the saved results.

## Decision and limitations

Use purchase cadence to propose a reminder experiment with a fixed observation window.

Historical invoice lines; credits are not reliably matched to original sales. Gross purchases are not profit. Unidentified customers cannot support customer-level conclusions. Exact repeated lines remain unless the study explicitly compares removal. 

Related studies may share observations or holdouts. These are focused analytical studies, not independent replications or deployed business systems. Any model refinements informed by these results need new untouched evaluation data. No commercial impact is inferred from an association or backtest.

## Reproduce

From the repository root, after installing `requirements.txt`:

```powershell
python projects/007-observed-reorder-intervals/analysis.py
```

Source data are downloaded automatically if absent. Original archives are retained unchanged and checked by SHA-256. The cleaned cache normalizes column names; field-specific changes are visible in [data preparation](../../portfolio/data.py). Runtime evidence is in [receipt.json](outputs/receipt.json).

## Source

[Online Retail](https://archive.ics.uci.edu/dataset/352/online+retail), Chen (2015). [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/). Source data are transformed and aggregated in this study. [Source provenance](../../data/provenance/retail.json) and [prepared-data audit](../../data/provenance/retail_prepared.json) record the downloaded files, field coverage and hashes.
