Economic Equilibria in Type Theory Cezar Ionescu (PIK) with Paul - - PowerPoint PPT Presentation

economic equilibria in type theory
SMART_READER_LITE
LIVE PREVIEW

Economic Equilibria in Type Theory Cezar Ionescu (PIK) with Paul - - PowerPoint PPT Presentation

Types 11, Bergen, 811.09.2011 Economic Equilibria in Type Theory Cezar Ionescu (PIK) with Paul Flondor (Politechnica University of Bucharest), Edwin Brady (University of St. Andrews), and members of the Cartesian Seminar (PIK & Uni


slide-1
SLIDE 1

Types 11, Bergen, 8–11.09.2011

Economic Equilibria in Type Theory

Cezar Ionescu (PIK) with Paul Flondor (Politechnica University of Bucharest), Edwin Brady (University of St. Andrews), and members of the Cartesian Seminar (PIK & Uni Potsdam)

slide-2
SLIDE 2

Types 11, Bergen, 8–11.09.2011

Motivation

Integrated assessment models are used to answer questions such as “how will phasing out nuclear power plants affect Germany’s unemployment?”. We focus on the economic models because

  • 1. Most integrated assessment models contain an economic

component.

  • 2. Economic models have more structure than some of the other
  • components. (More opportunity to reuse software

components).

  • 3. There is more need for improving economic theory than

physical theory.

  • 4. My boss is an economist.
slide-3
SLIDE 3

Types 11, Bergen, 8–11.09.2011

Game theory 101

Example: A two-person finite game. Strategy sets: first player can choose from {T, B }, second player from {L, R }. A play consists of each agent making a choice from their strategy set. Agents have preferences on plays (often induced by a payoff function). Typical representation:

L R T (TL, LT) (TR, RT) B (BL, LB) (BR, RB)

Essential question: what are “good” plays?

slide-4
SLIDE 4

Types 11, Bergen, 8–11.09.2011

Game context

module GameContext′′ (nA′ : Nat) where nA : Nat nA = S nA′ Agent : Set Agent = Fin nA module GameContext′ (Strategy : Agent → Set) where Play : Set Play = (a : Agent) → Strategy a module GameContext ( prefs : (a : Agent) → TotalPreorder Play) where

slide-5
SLIDE 5

Types 11, Bergen, 8–11.09.2011

Some examples

Sometimes, it’s clear what a good play is . . .

L R T (1, 1) (0, 0) B (0, 0) (0, 0)

slide-6
SLIDE 6

Types 11, Bergen, 8–11.09.2011

Some examples

Sometimes, it’s clear what a good play is . . .

L R T (1, 1) (0, 0) B (0, 0) (0, 0)

slide-7
SLIDE 7

Types 11, Bergen, 8–11.09.2011

Some examples

Other times, it’s clear what a bad play is . . .

L R T (1, 0) (0, 4) B (3, 0) (2, 3)

slide-8
SLIDE 8

Types 11, Bergen, 8–11.09.2011

Some examples

Other times, it’s clear what a bad play is . . .

L R T (1, 0) (0, 4) B (3, 0) (2, 3)

slide-9
SLIDE 9

Types 11, Bergen, 8–11.09.2011

Pareto optimality (efficiency)

Pareto′ : Play → Set Pareto′ p ∗ = (∀(p : Play) → ¬ (( ∀ (a : Agent) → (prefs a) ⊢ p p∗) ∃ (λ(a : Agent) → (prefs a) ⊢ p > p∗))) Pareto : Play → Set Pareto p ∗ = ∀ (p : Play) → (∀(a : Agent) → (prefs a) ⊢ p ∗ p) (∃(λ(a : Agent) → (prefs a) ⊢ p ∗ > p))

slide-10
SLIDE 10

Types 11, Bergen, 8–11.09.2011

Computing Pareto points

For finite games, we can use brute-force enumeration or somewhat cleverer methods such as sieving.

slide-11
SLIDE 11

Types 11, Bergen, 8–11.09.2011

Pareto points

As expected . . .

L R T (1, 1) (0, 0) B (0, 0) (0, 0)

slide-12
SLIDE 12

Types 11, Bergen, 8–11.09.2011

Pareto points

As expected . . .

L R T (1, 0) (0, 4) B (3, 0) (2, 3)

slide-13
SLIDE 13

Types 11, Bergen, 8–11.09.2011

Pareto points

There’s something unsatisfactory here . . .

L R T (1, 0) (0, 4) B (3, 0) (2, 3)

slide-14
SLIDE 14

Types 11, Bergen, 8–11.09.2011

Pareto points

Not all Pareto points are equally plausible . . .

L R T (1, 0) (0, 4) B (3, 0) (2, 3)

slide-15
SLIDE 15

Types 11, Bergen, 8–11.09.2011

Nash equilibria

Nash′ : Play → Set Nash′ p∗ = ∀ (a : Agent) → ∀(p : Play) → ¬ (prefs a ⊢ (change p ∗ at a to (p a)) > p) Nash : Play → Set Nash p ∗ = ∀ (a : Agent) → ∀(p : Play) → prefs a ⊢ p ∗ (change p ∗ at a to (p a))

slide-16
SLIDE 16

Types 11, Bergen, 8–11.09.2011

Computing Nash equilibria

For finite games, by enumeration etc.

slide-17
SLIDE 17

Types 11, Bergen, 8–11.09.2011

The prisoner’s dilemma

L R T (3, 3) (0, 5) B (5, 0) (1, 1)

slide-18
SLIDE 18

Types 11, Bergen, 8–11.09.2011

Pareto points for the prisoner’s dilemma

L R T (3, 3) (0, 5) B (5, 0) (1, 1)

slide-19
SLIDE 19

Types 11, Bergen, 8–11.09.2011

Nash equilibrium for prisoner’s dilemma

L R T (3, 3) (0, 5) B (5, 0) (1, 1)

slide-20
SLIDE 20

Types 11, Bergen, 8–11.09.2011

A game with no Nash equilibrium

L R T (0, 2) (2, 0) B (2, 0) (0, 2)

slide-21
SLIDE 21

Types 11, Bergen, 8–11.09.2011

Introducing mixed Nash equilibrium

We change the game: agents can choose probability distributions

  • ver their strategy sets.

L R T (0, 2) (2, 0) B (2, 0) (0, 2)

slide-22
SLIDE 22

Types 11, Bergen, 8–11.09.2011

Mixed Nash equilibrium

module MixedStrategyContext (Strategy : Agent → Set; payoff : (a : Agent) → ((a : Agent) → Strategy a) → Float) where MixedStrategy : (a : Agent) → Set MixedStrategy a = SimpleProb (Strategy a) MixedPlay : Set MixedPlay = (a : Agent) → MixedStrategy a

slide-23
SLIDE 23

Types 11, Bergen, 8–11.09.2011

Mixed Nash equilibrium

expected payoff : (a : Agent) → MixedPlay → Float expected payoff a mp = expected (fmap ((payoff a)) (mixedPlayToProbPlay mp)) prefs : (a : Agent) → TotalPreorder MixedPlay prefs a = InducedPreorder floatPreorder (expected payoff a)

  • pen GameContext′ MixedStrategy
  • pen GameContext prefs renaming (Nash to MixedNash)
slide-24
SLIDE 24

Types 11, Bergen, 8–11.09.2011

Computing mixed Nash equilibrium

. . . is hard! In fact, NP-hard (Goldberg and Papadimitriou, 2005).

slide-25
SLIDE 25

Types 11, Bergen, 8–11.09.2011

Mixed Nash equilibrium

pL = 0.5, pT = 0.5

L R T (0, 2) (2, 0) B (2, 0) (0, 2)

slide-26
SLIDE 26

Types 11, Bergen, 8–11.09.2011

Nash equilibrium example

Example: BoS

L R T (2, 1) (0, 0) B (0, 0) (1, 2)

slide-27
SLIDE 27

Types 11, Bergen, 8–11.09.2011

Nash equilibrium example

Pure Nash equilibria:

L R T (2, 1) (0, 0) B (0, 0) (1, 2)

slide-28
SLIDE 28

Types 11, Bergen, 8–11.09.2011

Nash equilibrium example

Problem: Pure equilibria are unfair!

L R T (2, 1) (0, 0) B (0, 0) (1, 2)

slide-29
SLIDE 29

Types 11, Bergen, 8–11.09.2011

Nash equilibrium example

pT = 2 / 3, pR = 2 / 3 Expected payoffs: 2 / 3 each.

L R T (2, 1) (0, 0) B (0, 0) (1, 2)

slide-30
SLIDE 30

Types 11, Bergen, 8–11.09.2011

Nash equilibrium example

pR = 2 / 3, pT = 2 / 3 Expected payoffs: 2 / 3 each: we cannot avoid miscoordination, if we want fairness.

L R T (2, 1) (0, 0) B (0, 0) (1, 2)

slide-31
SLIDE 31

Types 11, Bergen, 8–11.09.2011

Introducing correlated equilibrium

We change the game again. A new object: A simple probability distribution on plays. Interpretation: A coordinator advises agents how to play.

L R T PTL, (T, L) PTR, (T, R) B PBL, (B, L) PBR, (B, R)

slide-32
SLIDE 32

Types 11, Bergen, 8–11.09.2011

Introducing correlated equilibrium

Example: avoiding miscoordination in BoS.

L R T 0.3, (T, L) 0.0, (T, R) B 0.0, (B, L) 0.7, (B, R)

slide-33
SLIDE 33

Types 11, Bergen, 8–11.09.2011

Introducing correlated equilibrium

Strategies: Agent a now chooses a function φ a from Strategy a → Strategy a.

L R T 0.3, (T, L) 0.0, (T, R) B 0.0, (B, L) 0.7, (B, R)

slide-34
SLIDE 34

Types 11, Bergen, 8–11.09.2011

Introducing correlated equilibrium

Example: The first agent chooses id : {T, B } → {T, B }, the second chooses ¬ : {L, R } → {L, R }.

L R T 0.3, (T, R) 0.0, (T, R) B 0.0, (B, L) 0.7, (B, L)

slide-35
SLIDE 35

Types 11, Bergen, 8–11.09.2011

Introducing correlated equilibrium

Payoffs are computed in the expected way.

L R T 0.3, (T, R) 0.0, (T, R) B 0.0, (B, L) 0.7, (B, L)

slide-36
SLIDE 36

Types 11, Bergen, 8–11.09.2011

Correlated equilibrium

module CorrelatedStrategyContext′ (Strategy : Agent → Set; payoff : (a : Agent) → ((a : Agent) → Strategy a) → Float) where Choice : Agent → Set Choice a = Strategy a → Strategy a Play ′ : Set Play ′ = (a : Agent) → Strategy a

  • pen GameContext′ Choice
slide-37
SLIDE 37

Types 11, Bergen, 8–11.09.2011

Correlated equilibrium

module CorrelatedStrategyContext (coord : SimpleProb Play ′) where expected payoff : Agent → Play → Float expected payoff a p = expected (fmap (payoff a) (fmap (change p) coord)) where change : Play → Play ′ → Play ′ change p p′ a = (p a) (p′ a) prefs : (a : Agent) → TotalPreorder Play prefs a = InducedPreorder floatPreorder (expected payoff a)

  • pen GameContext prefs renaming (Nash to CorrelatedEquilibrium)
slide-38
SLIDE 38

Types 11, Bergen, 8–11.09.2011

Correlated equilibrium example

PTL = 1 / 2, PBR = 1 / 2 Expected payoffs: 3 / 2 each.

L R T (2, 1) (0, 0) B (0, 0) (1, 2)

slide-39
SLIDE 39

Types 11, Bergen, 8–11.09.2011

Games of exchange

The quintessential economic situation: exchange of goods.

  • 1. Two agents, two goods, X units of the first good, Y units of

the second.

  • 2. Agent i has xi unit of the first good, and yi units of the

second.

  • 3. A distribution of goods to agents, such as ((x1, y1), (x2, y2)) is

called an allocation. Agents have preferences over allocations.

  • 4. Agents are allowed to exchange their goods in order to find a

better allocation: no throwing goods away, and no creation of goods: x1 + x2 = X, y1 + y2 = Y . What is a good allocation?

slide-40
SLIDE 40

Types 11, Bergen, 8–11.09.2011

Example: Cobb-Douglas economy

A typical example is the Cobb-Douglas economy, in which the agents preferences induced by the utility functions u1(x, y) = xay (1−a) u2(x, y) = xby (1−b) where 0 < a, b < 1.

slide-41
SLIDE 41

Types 11, Bergen, 8–11.09.2011

Introducing prices

If goods have prices px, py then an initial allocation gives each agent a budget: Bi = pxxi + pyyi. An agent has to solve: maximize u(x, y) such that pxx + p2y = Bi Whether the resulting allocation is feasible depends on the prices.

slide-42
SLIDE 42

Types 11, Bergen, 8–11.09.2011

Walrasian equilibrium

An allocation-price pair (x, p) is a Walrasian equilibrium if (1) the allocation is feasible, and (2) each agent is making an optimal choice from its budget set. In equations:

  • 1. n

i=1 xi = n i=1 ωi

  • 2. If x′i is preferred by agent i to xi, then px′i > pωi.

Varian, p. 325

slide-43
SLIDE 43

Types 11, Bergen, 8–11.09.2011

Walrasian equilibria

params (omega : Vect (Vect Float nG) nA, prices : Vect Float nG, prefs : Fin nA → TotalPreorder (Vect Float nG)) { Feasible : Vect (Vect Float nG) nA → Set; Feasible xss = SumCols xss === SumCols omega; Optimal : Vect (Vect Float nG) nA → Set; Optimal xss = forall (i : Fin nA, xss′ : Vect (Vect Float nG) nA) → gt (prefs i) (vlookup i xss′) (vlookup i xss) → gt floatOrder (prices .∗ (vlookup i xss′)) (prices .∗ (vlookup i xss)); WalrasEq : Vect (Vect Float nG) nA → Set; WalrasEq xss = And (Feasible xss) (Optimal xss);

slide-44
SLIDE 44

Types 11, Bergen, 8–11.09.2011

Computing Walrasian equilibria

How can we compute Walrasian equilibria? For the special case of the Cobb-Douglas economy, the solution can be computed analytically:

py px = (1−a)x1+(1−b)x2 ay1+by2

x∗

1 = B1a px

y ∗

1 = B1(1−a) py

In general, however, computing Walrasian equilibria involves a lot

  • f numerical methods (optimization, solving linear systems, etc.).
slide-45
SLIDE 45

Types 11, Bergen, 8–11.09.2011

Conclusions

We continue to develop the formalization of economic theory: local Nash equilibria (P. Flondor), general equilibrium, etc. Work has begun on a DSL for numerical methods (E. Brady). Ideally, one would like to have numerical methods implemented in terms of constructive reals, used in a constructive economic theory.