Skip to content
Rainbow docs menu

Reference · The Applied Higher-Order Functions catalogue

rainbow.algorithms.proofs.ahof.confidence-interval

The Applied Higher-Order Functions cataloguesrc/rainbow/algorithms/proofs/ahof/confidence_interval.clj1 definitions, 4 theorems

AHoF Confidence Interval: quantify the uncertainty of a point estimate by an interval that, over repeated sampling, covers the true parameter with a chosen confidence level (e.g. 95%). A symmetric interval is estimate +/- margin, where margin = z * standard-error; the interval [lower, upper] CONTAINS a value exactly when the value lies at or above the lower bound and at or below the upper bound: contains? value lower upper = (lower <= value) AND (value <= upper) over exact-rational bounds. Proved native and axiom-free: the containment test as a boolean conjunction of two decidable comparisons (via logic/if-data over Bool); that a value inside the interval is contained; that a value above the upper bound is not; and the certificates that a contained value satisfies both bounds (native nnrat/at-most). The estimate, standard error, and critical value are executable; what is proved is the interval-containment decision -- the coverage check behind confidence intervals. Requires nnrat/at-most, audit/decide-nnrat-at-most, logic/if-data, nnrat/decide-at-most-true-sound (all in the D63 checkpoint). Scope (measured by the kernel): this module has 4 worked instances (statements about specific values). None of its theorems is a guarantee about the algorithm for all inputs; `lein verify rainbow.algorithms.proofs.ahof.confidence-interval` prints this classification.

confidence-interval/contains?

DefinitionSource, line 61

confidence-interval/contains? :
  (x₁ x₂ x₃ : ℚ≥0)
  → data/Bool

ℚ≥0 = nnrat/NonnegativeRational

confidence-interval/contains-interior-value

TheoremWorked exampleNo axiomsSource, line 77

confidence-interval/contains-interior-value :
  → confidence-interval/contains? 5 3 7 = data/true

= = equality/Eq

confidence-interval/excludes-value-above

TheoremWorked exampleNo axiomsSource, line 85

confidence-interval/excludes-value-above :
  → confidence-interval/contains? 8 3 7 = data/false

= = equality/Eq

confidence-interval/contained-meets-lower

TheoremWorked exampleNo axiomsSource, line 93

confidence-interval/contained-meets-lower :
  → 3 ≤ 5

≤ = nnrat/at-most

confidence-interval/contained-meets-upper

TheoremWorked exampleNo axiomsSource, line 99

confidence-interval/contained-meets-upper :
  → 5 ≤ 7

≤ = nnrat/at-most