Documentation

LeanPool.AiyagariEquilibrium.DynamicProgramming.Stochastic

Stochastic dynamic programming with finitely many shocks #

The Bellman operator

T v s = sup { r (s, a) + β * ∑ z, p z (s, a) * v (g z (s, a)) | a ∈ Γ s }

where a shock z is drawn from a finite set with probabilities p z (s, a) and leads to the state g z (s, a). This is the deterministic operator of LeanEconomics.DynamicProgramming.Bellman with the successor state replaced by an expectation over successors.

Why this is a new structure rather than a reuse #

The deterministic program's continuation is v evaluated at one point. Here it is a convex combination of v at several points, which is not of that form, so the operator has to be rebuilt. Everything above the operator is reused unchanged: the same Blackwell conditions give the contraction, and the same Berge theorem gives continuity. Only the two facts about the expectation are new, and they are exactly the two properties of a probability distribution:

Shock probabilities may depend on the state and the action, which covers a Markov chain on a component of the state as the special case where they depend on that component alone.

Main results #

structure LeanEconomics.StochasticDynamicProgram (S : Type u_4) (A : Type u_5) (Z : Type u_6) [TopologicalSpace S] [TopologicalSpace A] [Fintype Z] :
Type (max (max u_4 u_5) u_6)

A stochastic dynamic program with finitely many shocks.

Instances For

    The expected continuation value of v after choosing a at s.

    Equations
    Instances For
      noncomputable def LeanEconomics.StochasticDynamicProgram.objective {S : Type u_1} {A : Type u_2} {Z : Type u_3} [TopologicalSpace S] [TopologicalSpace A] [Fintype Z] (D : StochasticDynamicProgram S A Z) (v : BoundedContinuousFunction S ℝ) (s : S) (a : A) :

      Current reward plus the discounted expected continuation value.

      Equations
      Instances For

        An average of values of v is no larger than the size of v. This is where p ≥ 0 and ∑ p = 1 first do their work.

        The Bellman operator as a bare function.

        Equations
        Instances For
          theorem LeanEconomics.StochasticDynamicProgram.le_bellmanFn {S : Type u_1} {A : Type u_2} {Z : Type u_3} [TopologicalSpace S] [TopologicalSpace A] [Fintype Z] (D : StochasticDynamicProgram S A Z) (v : BoundedContinuousFunction S ℝ) {s : S} {a : A} (ha : a ∈ D.feasible s) :
          D.objective v s a ≤ D.bellmanFn v s
          theorem LeanEconomics.StochasticDynamicProgram.bellmanFn_le {S : Type u_1} {A : Type u_2} {Z : Type u_3} [TopologicalSpace S] [TopologicalSpace A] [Fintype Z] (D : StochasticDynamicProgram S A Z) (v : BoundedContinuousFunction S ℝ) {s : S} {c : ℝ} (h : ∀ a ∈ D.feasible s, D.objective v s a ≤ c) :
          D.bellmanFn v s ≤ c

          The stochastic Bellman operator on bounded continuous functions.

          Equations
          Instances For

            Blackwell's conditions hold. Monotonicity is prob_nonneg: averaging with nonnegative weights preserves order. Discounting is prob_sum: the weights sum to one, so raising the continuation value by c raises the average by exactly c, and the objective by β * c.

            theorem LeanEconomics.StochasticDynamicProgram.exists_optimal_action {S : Type u_1} {A : Type u_2} {Z : Type u_3} [TopologicalSpace S] [TopologicalSpace A] [Fintype Z] (D : StochasticDynamicProgram S A Z) (v : BoundedContinuousFunction S ℝ) (s : S) :
            ∃ a ∈ D.feasible s, (D.bellman v) s = D.objective v s a ∧ ∀ b ∈ D.feasible s, D.objective v s b ≤ D.objective v s a

            The supremum is attained: an optimal action exists at every state.

            The value function of the stochastic program.

            Equations
            Instances For
              theorem LeanEconomics.StochasticDynamicProgram.exists_optimal_policy {S : Type u_1} {A : Type u_2} {Z : Type u_3} [TopologicalSpace S] [TopologicalSpace A] [Fintype Z] (D : StochasticDynamicProgram S A Z) (s : S) :
              ∃ a ∈ D.feasible s, D.valueFunction s = D.reward (s, a) + ↑D.discount * ∑ z : Z, (D.prob z) (s, a) * D.valueFunction ((D.transition z) (s, a))

              The stochastic Bellman equation. At every state there is an optimal action, and the value is the reward it earns plus the discounted expected value of the successor state.