@@ -311,13 +311,13 @@ The max-min problem associated with firm 2's Lagrangian
311311component of firm $2$'s payoff function depends on the entire
312312future of its choices of $\{q_{2t+j}\}_{j=0}^\infty$.
313313314-This renders a direct attack on the problem cumbersome.
314+This renders a direct attack on the problem in the space of sequences cumbersome.
315315316-Therefore, below we will formulate the Stackelberg leader's problem
316+Therefore, below we will formulate the Stackelberg leader's problem
317317recursively.
318318319-We'll put our little duopoly model into a broader class of models with
320-the same structure.
319+We'll proceed by putting our duopoly model into a broader class of models with
320+the same general structure.
321321322322## Stackelberg Problem
323323@@ -440,14 +440,14 @@ $$
440440\Omega(y_0) = \left\{ (\vec y_1, \vec u_0) : y_{t+1} = A y_t + B u_t, \forall t \geq 0 \right\}
441441$$
442442443-Please remember that the follower's Euler equation is embedded in the
443+Please remember that the follower's system of Euler equations is embedded in the
444444system of dynamic equations $y_{t+1} = A y_t + B u_t$.
445445446-Note that in the definition of $\Omega(y_0)$, $y_0$
447-is taken as given.
446+Note that the definition of $\Omega(y_0)$ treats $y_0$
447+as given.
448448449449Although it is taken as given in $\Omega(y_0)$,
450-eventually, the $x_0$ component of $y_0$ will be chosen by the
450+eventually, the $x_0$ component of $y_0$ is to be chosen by the
451451Stackelberg leader.
452452453453### Two Subproblems
@@ -490,8 +490,7 @@ given.
490490Subproblem 2 optimizes over $x_0$.
491491492492The value function $w(z_0)$ tells the value of the Stackelberg plan
493-as a function of the vector of natural state variables at time $0$,
494-$z_0$.
493+as a function of the vector of natural state variables $z_0$ at time $0$.
495494496495## Two Bellman Equations
497496@@ -554,20 +553,50 @@ which implies that
554553555554$$
556555x_0 = - P_{22}^{-1} P_{21} z_0
557-$$
556+$$ (eq:subprob2x0)
558557559-## Stackelberg Plan
558+## Stackelberg Plan for Duopoly
560559561560Now let's map our duopoly model into the above setup.
562561563-We will formulate a state space system
562+We formulate a state vector
564563565564$$
566565y_t = \begin{bmatrix} z_t \cr x_t \end{bmatrix}
567566$$
568567569-where in this instance $x_t = v_{1t}$, the time $t$ decision
570-of the follower firm 1.
568+where for our duopoly model
569+570+$$
571+z_t = \begin{bmatrix} 1 \cr q_{2t} \cr q_{1t} \end{bmatrix} , \quad x_t = v_{1t},
572+$$
573+574+575+where $x_t = v_{1t}$ is the time $t$ decision
576+of the follower firm 1, $u_t$ is the time $t$ decision of the leader firm 2 and
577+578+$$
579+v_{1t} = q_{1t+1} - q_{1t}, \quad u_t = q_{2t+1} - q_{2t} .
580+$$
581+582+For our duopoly model, initial conditions for the natural state variables in $z_t$ are
583+584+$$
585+z_0 = \begin{bmatrix} 1 \cr q_{20} \cr q_{10} \end{bmatrix}
586+$$
587+588+while $x_0 = v_{10} = q_{11} - q_{10}$ is a choice variable for the Stackelberg leader firm 2, one that will ultimately be chosen according an optimal rule prescribed by {eq}`eq:subprob2x0`
589+for subproblem 2 above.
590+591+That the Stackelberg leader firm 2 chooses $x_0 = v_{10}$ is subtle.
592+593+Of course, $x_0 = v_{10}$ emerges from the feedback-feedforward solution {eq}`sstack3` of firm 1's system of Euler equations, so that it is actually
594+firm 1 that sets $x_0$.
595+596+But firm 2 manipulates firm 1's choice through firm 2's choice of the sequence $\vec q_{2,1} = \{q_{2t+1}\}_{t=0}^\infty$.
597+598+599+571600572601### Calculations to Prepare Duopoly Model
573602@@ -903,19 +932,21 @@ $\vec q_2$.
903932### Time Consistency of Follower's Plan
904933905934The follower can solve its problem using dynamic programming because its
906-problem is recursive in **natural state variables**,
935+problem is recursive in what for it are the **natural state variables**,
907936namely
908937909938$$
910-\begin{bmatrix} 1 \cr q_{2t} \cr \tilde q_{10} \cr \tilde x_0 \end{bmatrix}
939+\begin{bmatrix} 1 \cr q_{2t} \cr \tilde q_{1t} \cr \tilde x_t \end{bmatrix}
911940$$
912941913942It follows that the follower's plan is time consistent.
914943915944## Computing Stackelberg Plan
916945917946Here is our code to compute a Stackelberg plan via the linear-quadratic
918-dynamic program describe above
947+dynamic program describe above.
948+949+Let's use it to compute the Stackelberg plan.
919950920951```{code-cell} python3
921952# Parameters
@@ -982,13 +1013,15 @@ for t in range(n):
9821013 π_leader[t] = -(yt[:, t].T @ π_matrix @ yt[:, t])
98310149841015# Display policies
985-print("Computed policy for Stackelberg leader\n")
1016+print("Computed policy for Continuation Stackelberg leader\n")
9861017print(f"F = {F}")
9871018```
98810199891020## Time Series for Price and Quantities
9901021991-The following code plots the price and quantities produced by the Stackelberg leader and follower.
1022+Now let's use the code to compute and display outcomes as a Stackelberg plan unfolds.
1023+1024+The following code plots quantities chosen by the Stackelberg leader and follower, together with the equilibrium output price.
99210259931026```{code-cell} python3
9941027q_leader = yt[1, :-1]
@@ -1008,7 +1041,7 @@ plt.show()
1008104110091042### Value of Stackelberg Leader
101010431011-We'll compute the present value earned by the Stackelberg leader.
1044+We'll compute the value $w(x_0)$ attained by the Stackelberg leader, where $x_0$ is given by the maximizer {eq}`eq:subprob2x0` of subproblem 2.
1012104510131046We'll compute it two ways and get the same answer.
10141047@@ -1042,10 +1075,10 @@ v_expanded = -((y0.T @ R @ y0 + ut[:, 0].T @ Q @ ut[:, 0] +
1042107510431076In the code below we compare two values
104410771045-- the continuation value $- y_t P y_t$ earned by a continuation
1046- Stackelberg leader who inherits state $y_t$ at $t$
1047-- the value of a **reborn Stackelberg leader** who inherits state
1048- $z_t$ at $t$ and is free to set $x_t = - P_{22}^{-1} P_{21}$
1078+- the continuation value $v(y_t) = - y_t' P y_t$ earned by a **continuation
1079+ Stackelberg leader** who inherits state $y_t$ at $t$
1080+- the value $w(\hat x_t)$ of a **reborn Stackelberg leader** who, at date $t$ along the Stackelberg plan, inherits state
1081+ $z_t$ at $t$ but who discards $x_t$ from the time $t$ continuation of the original Stackelberg plan and **resets** it to $ \hat x_t = - P_{22}^{-1} P_{21} z_t$
1049108210501083The difference between these two values is a tell-tale sign of the time
10511084inconsistency of the Stackelberg plan
@@ -1069,17 +1102,17 @@ fig, axes = plt.subplots(3, 1, figsize=(10, 7))
10691102axes[0].plot(range(n+1), (- F @ yt).flatten(), 'bo',
10701103 label='Stackelberg leader', ms=2)
10711104axes[0].plot(range(n+1), (- F @ yt_reset).flatten(), 'ro',
1072- label='continuation leader at t', ms=2)
1073-axes[0].set(title=r'Leader control variable $u_{t}$', xlabel='t')
1105+ label='reborn at t Stackelberg leader', ms=2)
1106+axes[0].set(title=r' $u_{t} = q_{2t+1} - q_t$', xlabel='t')
10741107axes[0].legend()
1075110810761109axes[1].plot(range(n+1), yt[3, :], 'bo', ms=2)
10771110axes[1].plot(range(n+1), yt_reset[3, :], 'ro', ms=2)
1078-axes[1].set(title=r'Follower control variable $x_{t}$', xlabel='t')
1111+axes[1].set(title=r' $x_{t} = q_{1t+1} - q_{1t}$', xlabel='t')
1079111210801113axes[2].plot(range(n), vt_leader, 'bo', ms=2)
10811114axes[2].plot(range(n), vt_reset_leader, 'ro', ms=2)
1082-axes[2].set(title=r'Leader value $v(y_{t})$', xlabel='t')
1115+axes[2].set(title=r'$v(y_{t})$ and $w(\hat x_t)$', xlabel='t')
1083111610841117plt.tight_layout()
10851118plt.show()