Expand description
Bayesian height prediction with conformal bounds for virtualized lists. Bayesian height prediction with conformal bounds for virtualized lists.
Predicts unseen row heights to pre-allocate scroll space and avoid scroll jumps when actual heights are measured lazily.
§Mathematical Model
§Bayesian Online Estimation
Maintains a Normal-Normal conjugate model per item category:
Prior: μ ~ N(μ₀, σ₀²/κ₀)
Likelihood: h_i ~ N(μ, σ²)
Posterior: μ | data ~ N(μ_n, σ²/κ_n)
where:
κ_n = κ₀ + n
μ_n = (κ₀·μ₀ + n·x̄) / κ_n
σ² estimated via running variance (Welford's algorithm)§Conformal Prediction Bounds
Given a calibration set of (predicted, actual) residuals, the conformal interval is:
[μ_n - q_{1-α/2}, μ_n + q_{1-α/2}]where q is the empirical quantile of |residuals|. This provides
distribution-free coverage: P(h ∈ interval) ≥ 1 - α.
§Failure Modes
| Condition | Behavior | Rationale |
|---|---|---|
| No measurements | Return default height | Cold start fallback |
| n = 1 | Wide interval (use prior σ) | Insufficient data |
| All same height | σ → 0, interval collapses | Homogeneous data |
| Actual > bound | Adjust + record violation | Expected at rate α |
Structs§
- Height
Prediction - A prediction with conformal bounds.
- Height
Predictor - Bayesian height predictor with conformal bounds.
- Predictor
Config - Configuration for the height predictor.