Stackelberg Leader

with Linear Demand

General Setup for Quantity Games

Mathematica notes are presented in this format.

Economic notes are in this format.

Setup for the problem.

Because we want to study the analytical solution to this simply problem, we need to tell Mathematica what the parameters (or constants) of the model are.  Everything else will be treated as a variable.  The semi-colons at the end of input lines suppress the display of output.

SetAttributes[a, Constant]  
SetAttributes[b, Constant]  
SetAttributes[c, Constant]

The Clear command tells Mathematica to wipe out any previous values associated with the listed variables.

Clear[a,b,c,temp1,temp2];  
Clear[Q1,Q2,eqPr1,eqPr1,focPr1,focPr2,R2,pie1s,pie2s];

Total market quantity (Q) is the sum of firm 1's qty (Q1) and firm 2's qty (Q2).

Q = Q1 + Q2 ;

Next, we specify a functional form for the inverse market demand faced by the duopolists; in this case a linear function.

Price = a - b*(Q) ;

Stackelberg Quantity Game

Stackelberg quantity games are similar to Cournot games in that both are quantity competitions.  In the Stackelberg game, however, firms do not choose quantities simultaneously.  Instead, a dominant firm (or Stackelberg leader) moves first by choosing its level of output in the first stage.  After observing the leader's move the other firm chooses its best response output in the second stage.  As we will see, the sequential play will require a different methodology and produces different results than those of the simultaneous move Cournot game.

Firm 2: the Stackelberg follower

As is typical with sequential games, we will solve the Stackelberg game backwards.  Thus we begin to solve the problem by characterizing how the Stackelberg follower (firm 2) will respond to the Stackelberg leader's choice of quantity.

eqPr2 = Profit2 == Q2*(P[Q1,Q2]-c2)

eqPr2 = Expand[%/. P[Q1,Q2] -> Price]

In Mathematica % refers to the last result generated (ie: %% uses the 2nd to last result generated) and /. is the replacement identifier.  So here we take the original profit equation and replace the general form of our demand equation P[Q1,Q2] with our explicit linear demand equation Price.  
In the next line of code, we define a new equation focPr2 (firm 2's foc) to be the derivative (D[ ]) of firm 2's profit (payoff) function with respect to its choice of its own quantity Q2.

focPr2 = D[eqPr2, Q2]

In the simply linear case, we can solve for firm 2's best response quatity explicitly as a function of firm 1's quantity choice.

temp2 = Solve[focPr2, Q2]

React2 = R2[Q1] == Simplify[Q2 /. temp2[[1]]]

Note:  This is the same reaction function that we found for firm 2 in the Cournot game.  In the Stackelberg problem there is on important caveate:  Recall from the Cournot game that R2[Q1] was interpreted as firm 2's best response to firm 1's hypothesized output Q1.  In the Stackelberg game, firm 2 knows Q1 for certain since it observed Q1 at the end of stage 1.  Therefore, firm 2 will respond to firm 1's observed output Q1 by producing:

Q2s = Simplify[R2[Q1] /.Solve[React2, R2[Q1]][[1]]]

Firm 1: the Stackelberg leader

eqPr1 = pie1s == Q1*(P[Q1,Q2]-c1)

eqPr1 = %/. P[Q1,Q2] -> Price

Because firm 1 can solve for firm 2's best response quantity as well as firm 2 can, firm 1 will anticipate firm 2's reaction to any choice of Q1.  Thus firm 1 solves the following:

eqPr1 = Simplify[%/. Q2 ->Q2s]

focPr1 = Simplify[D[eqPr1, Q1]]

Solution to the simply Stackelberg Game.

The solution to the Stackelberg game has the Stackelberg leader (firm 1) choosing its optimal quantity:

Q1s = Simplify[Q1 /.Solve[focPr1, Q1][[1]]]

Firm 2 (the follower) takes firm 1's quantity choice as given and reacts by choosing:

Q2s = Simplify[Q2s /. Q1 ->Q1s]

The resulting market quantity and market price are calculated by substituting the firms' optimal quantities into the quantity and price equations.

Qstack = Simplify[Q /. {Q1 -> Q1s, Q2 -> Q2s}]

Pstack = Simplify[Price /. Q -> %]

The profits from playing the Stackelberg Game to firm 1 and firm 2 respectively are:

pie1s = Simplify[Q1s*(Pstack - c1)]

pie2s = Simplify[Q2s*(Pstack - c2)]