Reference · Foundations
rainbow.math.monte-carlo-estimation
Direct Monte Carlo estimation of a failure probability. Given a finite list of sample outcomes (a boolean flag per sample, true = failure), the empirical failure frequency is the count of failures over the sample size, an exact rational. The count reduces a boolean indicator over the list; the estimate is a nonnegative rational.
estimation/nnrat-indicator
estimation/nnrat-indicator : (x₁ : data/Bool) → ℕ
ℕ = data/Nat
estimation/failure-count
estimation/failure-count : (x₁ : List data/Bool) → ℕ
List = data/Listℕ = data/Nat
estimation/monte-carlo-frequency
estimation/monte-carlo-frequency : (x₁ : List data/Bool) (x₂ : ℕ) → ℚ≥0
List = data/Listℕ = data/Natℚ≥0 = nnrat/NonnegativeRational
estimation/indicator-failure
estimation/indicator-failure : → estimation/nnrat-indicator data/true = 1
= = equality/Eq
estimation/indicator-success
estimation/indicator-success : → estimation/nnrat-indicator data/false = 0
= = equality/Eq
estimation/count-empty
estimation/count-empty : → estimation/failure-count [] = 0
= = equality/Eq