Documentation

CslibFrontier.Probability.OptimalStopping.Basic

Optimal stopping: independent observations and stopping rules #

Observations X₁, …, Xₙ arrive one at a time, drawn independently, Xᵢ from the i-th law of laws; jointLaw laws is the law of the whole list. Unlike Cslib.Probability.PMF.pi and Cslib.Probability.PMF.iid, the laws may differ, the value type need not be finite, and the outcome is a list, the form on which backward induction recurses.

A stopping rule stop : List α → Bool sees the history, most recent observation first, and decides whether to stop at the current observation. A reward reward past future may depend on the observations seen when stopping and on those still to come; the secretary problem, for instance, rewards stopping at the overall best, which depends on the future. payoff stop reward past xs is the reward collected on the remaining observations xs after the history past, and 0 if the rule never stops. Rules are deterministic. A randomized rule is a mixture of deterministic ones, so every bound below on deterministic rules also bounds randomized ones.

valueFrom reward laws past is the backward-induction (dynamic programming) value: at each step, the better of stopping now and continuing optimally. tsum_payoff_le_valueFrom shows that no stopping rule beats it, and tsum_payoff_optimalRule that the rule optimalRule, which stops exactly when stopping is at least as good as continuing, attains it (valueFrom_eq_iSup).

Main definitions #

Main results #

References #

noncomputable def Cslib.Probability.OptimalStopping.jointLaw {α : Type u_1} :
List (PMF α) → PMF (List α)

Independent observations, the i-th drawn from the i-th law, collected into a list.

theorem Cslib.Probability.OptimalStopping.jointLaw_cons {α : Type u_1} (μ : PMF α) (laws : List (PMF α)) :
jointLaw (μ :: laws) = μ.bind fun (x : α) => PMF.map (fun (x_1 : List α) => x :: x_1) (jointLaw laws)
theorem Cslib.Probability.OptimalStopping.jointLaw_append {α : Type u_1} (laws₁ laws₂ : List (PMF α)) :
jointLaw (laws₁ ++ laws₂) = (jointLaw laws₁).bind fun (xs : List α) => PMF.map (fun (x : List α) => xs ++ x) (jointLaw laws₂)

Observing two blocks of independent observations, one after the other.

theorem Cslib.Probability.OptimalStopping.tsum_jointLaw_cons_mul {α : Type u_1} (μ : PMF α) (laws : List (PMF α)) (k : List α → ENNReal) :
∑' (xs : List α), (jointLaw (μ :: laws)) xs * k xs = ∑' (x : α), μ x * ∑' (xs : List α), (jointLaw laws) xs * k (x :: xs)

An expectation under jointLaw conditions on the first observation.

noncomputable def Cslib.Probability.OptimalStopping.payoff {α : Type u_1} (stop : List α → Bool) (reward : List α → List α → ENNReal) :
List α → List α → ENNReal

The reward collected by the rule stop on the remaining observations xs after the history past (most recent first): it stops at the first x with stop (x :: past) and collects reward (x :: past) future, where future are the observations after x. A rule that never stops collects 0.

def Cslib.Probability.OptimalStopping.stopIndex {α : Type u_1} (stop : List α → Bool) :
List α → List α → Option ℕ

The position in xs at which the rule stop stops after the history past, if any.

theorem Cslib.Probability.OptimalStopping.stopIndex_lt {α : Type u_1} (stop : List α → Bool) (past xs : List α) {k : ℕ} :
stopIndex stop past xs = some k → k < xs.length
theorem Cslib.Probability.OptimalStopping.payoff_eq_stopIndex {α : Type u_1} (stop : List α → Bool) (reward : List α → List α → ENNReal) (past xs : List α) :
payoff stop reward past xs = (stopIndex stop past xs).elim 0 fun (k : ℕ) => reward ((List.take (k + 1) xs).reverse ++ past) (List.drop (k + 1) xs)

The payoff is the reward at the stopping time, and 0 if the rule never stops.

noncomputable def Cslib.Probability.OptimalStopping.valueFrom {α : Type u_1} (reward : List α → List α → ENNReal) :
List (PMF α) → List α → ENNReal

The backward-induction value of the remaining observations with laws laws after the history past: on observing x, the better of stopping, with expected reward over the remaining observations, and continuing optimally.

theorem Cslib.Probability.OptimalStopping.payoff_nil {α : Type u_1} (stop : List α → Bool) (reward : List α → List α → ENNReal) (past : List α) :
payoff stop reward past [] = 0
theorem Cslib.Probability.OptimalStopping.payoff_cons {α : Type u_1} (stop : List α → Bool) (reward : List α → List α → ENNReal) (past : List α) (x : α) (future : List α) :
payoff stop reward past (x :: future) = if stop (x :: past) = true then reward (x :: past) future else payoff stop reward (x :: past) future
theorem Cslib.Probability.OptimalStopping.valueFrom_nil {α : Type u_1} (reward : List α → List α → ENNReal) (past : List α) :
valueFrom reward [] past = 0
theorem Cslib.Probability.OptimalStopping.valueFrom_cons {α : Type u_1} (reward : List α → List α → ENNReal) (μ : PMF α) (laws : List (PMF α)) (past : List α) :
valueFrom reward (μ :: laws) past = ∑' (x : α), μ x * max (∑' (xs : List α), (jointLaw laws) xs * reward (x :: past) xs) (valueFrom reward laws (x :: past))
theorem Cslib.Probability.OptimalStopping.tsum_payoff_le_valueFrom {α : Type u_1} (stop : List α → Bool) (reward : List α → List α → ENNReal) (laws : List (PMF α)) (past : List α) :
∑' (xs : List α), (jointLaw laws) xs * payoff stop reward past xs ≤ valueFrom reward laws past

Backward induction: no stopping rule's expected payoff exceeds the backward-induction value.

noncomputable def Cslib.Probability.OptimalStopping.optimalRule {α : Type u_1} (reward : List α → List α → ENNReal) (laws : List (PMF α)) :
List α → Bool

The backward-induction rule for the observation laws laws: on the history h (most recent first), with the laws laws.drop h.length still to come, stop exactly when stopping is at least as good as continuing optimally.

theorem Cslib.Probability.OptimalStopping.tsum_payoff_optimalRule {α : Type u_1} (reward : List α → List α → ENNReal) (laws : List (PMF α)) :
∑' (xs : List α), (jointLaw laws) xs * payoff (optimalRule reward laws) reward [] xs = valueFrom reward laws []

Backward induction attains the value: the rule optimalRule collects exactly the backward-induction value.

theorem Cslib.Probability.OptimalStopping.valueFrom_eq_iSup {α : Type u_1} (reward : List α → List α → ENNReal) (laws : List (PMF α)) :
valueFrom reward laws [] = ⨆ (stop : List α → Bool), ∑' (xs : List α), (jointLaw laws) xs * payoff stop reward [] xs

The backward-induction value is the best expected payoff of any stopping rule.