# Piike Index (PI) — Methodology

**Version:** 3
**Last updated:** 2026-03-28
**Contact:** methodology@piike.co

---

## What is the Piike Index?

The Piike Index (PI) is a composite 0–100 rating for competitive divers.
It is designed to answer a single question:

> **How strong is this diver relative to their peers, across all the things that matter in competition?**

A PI of 100 is a theoretical ceiling — no diver reaches it. The distribution
across the population is roughly:

| Tier | Range | Description |
|------|-------|-------------|
| **Elite** | 82–100 | Top ~2–3% of collegiate divers |
| **All-American** | 72–81 | Top ~10% |
| **Conference** | 60–71 | Competitive at conference level |
| **Varsity** | 45–59 | Contributing varsity diver |
| **Developing** | 30–44 | Still developing consistency |
| **Newcomer** | 0–29 | Early competitive data |

Tiers are computed from the same thresholds everywhere in the codebase
(`src/lib/piike-index/tiers.ts`).

---

## Components and Weights

PI is a weighted average of five component scores, each normalized to 0–100:

| Component | Weight | What it measures |
|-----------|--------|-----------------|
| **Execution** | 40% | Raw judge award quality |
| **DD** | 25% | Dive list difficulty |
| **Consistency** | 20% | Reliability across meets |
| **Versatility** | 10% | Breadth of dive group coverage |
| **Context** | 5% | Placement quality |

---

## Component Definitions

### Execution (40%)

**Formula:** `total_score / total_dd`, averaged across meets

This strips out degree of difficulty to isolate pure judge award quality.
When a diver scores 280 points in a 6-dive event with total DD = 14.0, the
award value is `280 / 14.0 = 20.0` — what the judges effectively awarded
per unit of difficulty.

**Normalization:**
- Floor: 12 (weak execution, judges averaging ~6–7)
- Ceiling: 22 (elite execution, judges averaging ~9+)
- `execution = clamp(((avg_award − 12) / (22 − 12)) × 100)`

**Fallback:** When `total_dd` is unavailable, we estimate award as
`(total_score / num_dives) / 2.0` using an assumed average DD of 2.0.
This is less accurate and is flagged for divers using the fallback.

---

### DD — Difficulty (25%)

**Formula:** Mean DD per dive across the diver's dive list

A diver competing `301C` (DD 1.6) and `105B` (DD 2.6) has an average DD
of 2.1. Higher average DD reflects a harder, more complete dive list.

**Normalization:**
- Floor: 1.5 avg DD per dive (easy list)
- Ceiling: 3.2 avg DD per dive (elite list)
- `dd = clamp(((avg_dd − 1.5) / (3.2 − 1.5)) × 100)`

**Data source:** `diver_dives.dd` — derived from USA Diving DD tables.

---

### Consistency (20%)

**Formula:** Inverse standard deviation of execution award values across meets

Using the same `total_score / total_dd` award metric as Execution, we
compute the sample standard deviation across all meets:

```
variance = Σ(award_i − mean_award)² / (n − 1)
stddev = √variance
consistency = clamp(((4 − stddev) / 4) × 100)
```

- Stddev 0 = perfect consistency → score 100
- Stddev 4+ = very erratic → score 0

**Small-sample dampening:** With fewer than 3 data points, standard
deviation from 2 samples can swing to extremes (0 or 100) due to sampling
noise. We blend toward neutral (50) when n < 3:

```
if n < 3: consistency = consistency × 0.3 + 50 × 0.7
```

This means a diver with only 2 results never receives a raw consistency
score — it is always tempered toward neutral until sufficient data exists.

---

### Versatility (10%)

**Formula:** Number of distinct dive groups competed ÷ 6

The six USA Diving dive groups are:
1. Forward
2. Back
3. Reverse
4. Inward
5. Twisting
6. Armstand (platform only)

`versatility = clamp((groups / 6) × 100)`

A diver competing in 3 groups scores ~50; 5 groups ≈ 83; all 6 = 100.
Most collegiate springboard divers compete in 4–5 groups.

---

### Context (5%)

**Formula:** Weighted blend of win rate, podium rate (top-3), and top-6 rate

```
context = (win_rate × 0.5 + podium_rate × 0.35 + top6_rate × 0.15) × 100
```

Podium and win rates are noisy with small meet samples, so Context carries
only 5% weight. It rewards consistent high placements without
over-penalizing divers who compete primarily in large fields.

**Default:** 50 (neutral) when placement data is unavailable.

---

## Minimum Data Requirements

PI is not computed until:
- At least **2 non-combined competition results** with `total_score` available
- At least **2 execution award values** computable from those results

Divers below this threshold show PI = `—` and are unranked.

Combined/consolation events (marked `is_combined = true`) are excluded
to prevent inflated scores from merged-field events.

---

## Update Frequency

PI scores are recalculated:
- After each meet finalization (`finalize_meet_results` RPC)
- On-demand via `SELECT refresh_piike_scores()` (runs nightly)

---

## Known Limitations

1. **No live-meet data.** PI uses only finalized meet results. In-season
   form changes only appear after meets are finalized.

2. **Fallback when DD is missing.** ~15% of scraped results lack total_dd.
   The fallback (assumed avg DD 2.0) underestimates execution for divers
   with hard lists. Affected divers are identifiable by `total_dd IS NULL`
   in `competition_results`.

3. **Context doesn't weight field size.** Winning a 4-person dual meet
   counts the same as winning an NCAA championship. This will be addressed
   in a future competition-level weighting feature.

4. **No event-type separation.** 1m, 3m, and platform are treated as a
   single career. A 3m specialist will have their DD partially diluted by
   easier 1m entries.

5. **Small-sample noise.** Divers with 2–4 meets have high uncertainty.
   Confidence intervals will be surfaced in a future release.

---

## Version History

| Version | Date | Changes |
|---------|------|---------|
| v1 | 2025-06 | Initial release. Execution used per-dive total scores. |
| v2 | 2025-10 | Added is_combined filter. Separated event-specific results. |
| v3 | 2026-03 | Execution rewritten to use `total_score / total_dd`. Consistency rewritten to use stddev of award values. Tier thresholds unified across codebase. Small-sample dampening for consistency. |
