Notes: Glosten and Milgrom (1985)

1. Introduction

In this post, I replicate the main results from Glosten and Milgrom (1985) using the setup outlined in Back and Baruch (2003). I begin in Section 2 by laying out the continuous time asset pricing framework. I consider the behavior of an informed trader who trades a single risky asset with a market maker that is constrained by perfect competition. Then, in Section 3 I solve for the optimal trading strategy of the informed agent as a system of first order conditions and boundary constraints. Finally, I show how to numerically compute comparative statics for this model.

2. Asset Pricing Framework

There is a single risky asset which pays out v \in \{0,1\} at a random date \tau > 0. There is an informed trader and a stream of uninformed traders who arrive with Poisson intensity \beta. All traders have a fixed order size of \delta  = 1. The model end date \tau is distributed exponentially with intensity \kappa.

Let z_{t-} denote the net position of the noise traders up to but not including date t and let x_{t-} denote the net position of the informed up to but not including date t. The market maker sees an anonymous order flow at each time t of dy_t = dx_t + dz_t so that \{y_s \mid s \leq t\} generates a \sigma-field \mathcal{F}_t^y which represents the market maker’s information set.

Perfect competition dictates that the market maker sets the price of the risky asset p_t = \mathbb{E}\left[ \ v \ \middle| \ \mathcal{F}_t^y \ \right]. Let b_t and a_t denote the bid and ask prices at time t.

(1)   \begin{align*} a_t &= \mathbb{E} \left[ \ v \ \middle| \ \mathcal{F}_{t-}^y, \ dy_t = 1 \ \right] \\ b_t &= \mathbb{E} \left[ \ v \ \middle| \ \mathcal{F}_{t-}^y, \ dy_t = -1 \ \right] \end{align*}

Let p_{t-} be the left limit of the price p at time t. Given that v \in \{0,1\}, we can interpret p_{t-} as the probability of the event v=1 at time t given the information set \mathcal{F}_{t-}^y. The informed trader chooses a trading strategy \{dx_t\}_{t \leq \tau} in order to maximize his end of game wealth at random date \tau with 0 discount rate. Let dx_t^+ = \max\{0,dx_t\} and let dx_t^- = \min\{0,dx_t\}.

(2)   \begin{align*} w &= \max_{\{dx_t\}_{t \leq \tau}} \left\{ \mathbb{E} \left[ \ \int_0^\tau \left( v - a_t \right) \cdot dx_t^+ + \int_0^\tau \left( b_t - v \right) \cdot dx_t^- \ \middle| \ v \ \right] \right\} \end{align*}

In order to guarantee a solution to the optimization problem posed above, I restrict the domain of potential trading strategies to those that generate finite end of game wealth.

(3)   \begin{align*} \infty > \max_{\{dx_t\}_{t \leq \tau}} \left\{ \mathbb{E} \left[ \ \int_0^\tau \left( v - a_t \right) \cdot dx_t^+ \ \middle| \ v = 1 \ \right] \right\} \\ \infty > \max_{\{dx_t\}_{t \leq \tau}} \left\{ \mathbb{E} \left[ \ \int_0^\tau \left( b_t - v \right) \cdot dx_t^- \ \middle| \ v = 0 \ \right] \right\} \end{align*}

I then look for probabilistic trading intensities which make the net position of the informed trader a martingale.

Definition: At each time t \leq \tau, an equilibrium consists of a pair of bid and ask prices,

(4)   \begin{align*} \begin{bmatrix} b & a \end{bmatrix}_{s \leq t} \end{align*}

as well as a vector of trading intensities,

(5)   \begin{align*} \Theta &= \begin{bmatrix} \theta_{H,B} & \theta_{H,S} & \theta_{L,B} & \theta_{L,S} \end{bmatrix}_{s \leq t} \end{align*}

such that the prices equal the conditional expectation of the asset value relative to \mathcal{F}_{t-}^y given a sell or buy order and the trading intensities solve the informed agent’s objective function, satisfy the finiteness conditions and are martingales relative to the informed trader’s information set \mathcal{F}_{t-}^y:

(6)   \begin{align*} 0 &= \mathbb{E} \left[ \ x_t^+ - v \cdot \int_0^t \theta_{H,B} \left( p_{s-} \right) \cdot ds - \left( 1 - v \right) \cdot \int_0^t \theta_{L,B} \left( p_{s-}\right) \cdot ds \ \middle| \ \mathcal{F}_{t-}^y \ \right] \\ 0 &= \mathbb{E} \left[ \ x_t^- - v \cdot \int_0^t \theta_{H,S} \left( p_{s-} \right) \cdot ds - \left( 1 - v \right) \cdot \int_0^t \theta_{L,S} \left( p_{s-}\right) \cdot ds \ \middle| \ \mathcal{F}_{t-}^y \ \right] \end{align*}

In the definition above, the \{H,L\} and \{B,S\} subscripts denote the realized value and trade directions for the informed traders. So, for example, \theta_{H,B} denotes the trading intensity at some time t in the buy direction of an informed trader who knows that the value of the asset is v=1.

3. Optimal Trading Strategies

I now characterize the equilibrium trading intensities of the informed traders. First, observe that since \tau is distributed exponentially, the only relevant state variable is p_{t-} at time t. Thus, in the equations below, I drop the time dependence wherever it causes no confusion.

Since the bid and ask prices are conditional expectations, we can compute their values using Bayes’ rule.

(7)   \begin{align*} a(p) &= \left( \frac{ p \cdot \theta_{H,B} ( p ) }{p \cdot \theta_{H,B}(p) + ( 1 - p ) \cdot \theta_{L,B} (p) + \beta} \right) \cdot 1 \\ &\qquad \qquad + \left( \frac{( 1 - p ) \cdot \theta_{L,B}(p)}{p \cdot \theta_{H,B}(p) + ( 1 - p ) \cdot \theta_{L,B} (p) + \beta} \right) \cdot 0 \\ &\qquad \qquad \qquad \qquad + \left( \frac{\beta}{p \cdot \theta_{H,B} \left( p \right) + ( 1 - p ) \cdot \theta_{L,B} (p) + \beta} \right) \cdot p \\ &= \frac{ p \cdot \theta_{H,B} ( p ) + p \cdot \beta}{p \cdot \theta_{H,B} ( p ) + ( 1 - p ) \cdot \theta_{L,B} ( p ) + \beta} \\ b(p) &= \frac{p \cdot \theta_{H,S} ( p ) + p \cdot \beta(p)}{p \cdot \theta_{H,S} ( p ) + ( 1 - p ) \cdot \theta_{L,S} (p ) + \beta} \end{align*}

I now want to derive a set of first order conditions regarding the optimal decisions of high and low type informed agents as functions of these bid and ask prices which can be used to pin down the equilibrium vector of 4 trading intensities. Let w_H(p) and w_L(p) denote the value functions of the high and low type informed traders respectively.

Condition 1: No arbitrage implies that a(p) > p > b(p) for all p \in (0,1) with a(0) = 0 = b(0) and a(1) = 1 = b(1) since:

(8)   \begin{align*} \mathbb{E} \left[ \ v \ \middle| \ \mathcal{F}_{t-}^y, \ dy_t = 1 \ \right] \geq  \mathbb{E} \left[ \ v \ \middle| \ \mathcal{F}_{t-}^y \  \right] \geq  \mathbb{E} \left[ \ v \ \middle| \ \mathcal{F}_{t-}^y, \ dy_t = -1 \ \right] \end{align*}

Thus, for all p \in (0,1) it must be that \theta_{H,B}(p) > \theta_{L,B}(p) > 0 and \theta_{L,S}(p) > \theta_{H,S}(p) > 0. What’s more, p=1 and p=0 are absorbing points for p meaning that w_L(0) = w_H(1) = 0 while w_L(1) = w_H(0) = \infty.

Condition 2: The around a buy or sell order, the price moves by jumping from p \nearrow a(p) or from p \searrow b(p) so we can think about the stochastic process dp as composed of a deterministic drift component \mu(p) and 2 jump components with magnitudes \{a(p) - p\} and \{b(p) - p\}.

(9)   \begin{align*} \mathbb{E}\left[ dp \right] &= \mu(p) \cdot dt + \lambda_a \cdot \left\{ a(p) - p \right\} \cdot dt + \lambda_b \cdot \left\{ b(p) - p \right\} \cdot dt \end{align*}

The probabilities \lambda_a and \lambda_b can be computed using Bayes’ rule.

(10)   \begin{align*} \lambda_a &= p \cdot \theta_{H,B}(p) + (1 - p) \cdot \theta_{L,B}(p) + \beta \\ \lambda_b &= p \cdot \theta_{H,S}(p) + (1 - p) \cdot \theta_{L,S}(p) + \beta \end{align*}

Substituting in the formulas for a(p) and b(p) from above yields an expression for the price change that is purely in terms of the trading intensities and the price.

(11)   \begin{align*} \mathbb{E}\left[dp\right] &= \mu(p) \cdot dt + p \cdot \left( 1 - p \right) \cdot \left( \theta_{H,B}(p) + \theta_{H,S}(p) - \theta_{L,B}(p) - \theta_{L,S}(p) \right) \cdot dt \end{align*}

However, via the conditional expectation price setting rule, dp must be a martingale meaning that \mathbb{E}[dp] = 0.

(12)   \begin{align*} \mu(p) &= p \cdot \left( 1 - p \right) \cdot \left( \theta_{L,B}(p) + \theta_{L,S}(p) - \theta_{H,B}(p) - \theta_{H,S}(p) \right) \end{align*}

Condition 3: At the time of a buy or sell order, smooth pasting implies that the informed trader was indifferent between placing the order or not. For instance, if he strictly preferred to place the order, he would have done so earlier via the continuity of the price process.

(13)   \begin{align*} w_H(p) &= \left(  1 - a(p) \right) + w_H( a(p) ) \\ w_L(p) &= b(p) + w_L ( b(p) ) \end{align*}

Condition 4: It is not optimal for the informed traders to bluff. i.e., a high type informed trader can never increase his value function by selling at time t and vice versa for a low type informed trader.

(14)   \begin{align*} w_H(p) &\geq \left(  b(p) - 1 \right) + w_H ( b(p) ) \\ w_L(p) &= -a(p) + w_L ( a(p) ) \end{align*}

Condition 5: In all time periods in which the informed trader does not trade, smooth pasting implies that he must be indifferent between trading and delaying an instant dt. There are 2 forces at work here. In each instant dt, there is a \kappa probability that \tau will arrive and the informed trader’s value function will plummet to 0. This cost has to be offset by the value delaying. For the high type informed trader, this value includes the value change due to the price drift (dw_H/dp) \cdot \mu(p), the value change due to an uninformed trader placing a buy order with probability \beta and the value change due to an uninformed trader placing a sell order with probability \beta. Similar reasoning yields a symmetric condition for low type informed traders.

(15)   \begin{align*} \kappa \cdot w_H(p) &= w_H'(p) \cdot \mu(p) + \beta \cdot \left( w_H( a(p)) - w_H(p) \right) + \beta \cdot \left( w_H( b(p) ) - w_H(p) \right) \\ \kappa \cdot w_L(p) &= w_L'(p) \cdot \mu(p) + \beta \cdot \left( w_L( a(p) ) - w_L(p) \right) + \beta \cdot \left( w_L( b(p) ) - w_L(p) \right) \end{align*}

This combination of 5 conditions pins down the equilibrium.

Proposition: If the trading strategies are admissible, w_H is a non-increasing function of p, w_L is a non-decreasing function of p, both value functions satisfy the 5 conditions above, and the trading strategies are continuously differentiable on the interval (0,1), then the trading strategies are optimal for all t.

In the section below, I solve for the equilibrium trading intensities and prices numerically.

4. Numerical Solution

In the results below, I set \beta = 1/2 and \kappa = 1 for simplicity. I compute the value functions w_H and w_L as well as the optimal trading strategies \Theta on a grid over the unit interval with N nodes. Let \mathbf{P} denote the vector of N prices.

(16)   \begin{align*} \mathbf{P} = \begin{bmatrix} p_1 & p_2 & \cdots & p_N \end{bmatrix} \end{align*}

Let \mathbf{W}_H(\mathbf{P};\mathtt{i}) and \mathbf{W}_L(\mathbf{P};\mathtt{i}) denote the vector of value function levels over each point in the price grid \mathbf{P} after iteration \mathtt{i}. I use the teletype style i to denote the number of iterations in the optimization algorithm. w_H(p_n;\mathtt{i}) denotes the level of the value function at price point p_n after \mathtt{i} iterations.

(17)   \begin{align*} \mathbf{W}_H(\mathbf{P};\mathtt{i}) &= \begin{bmatrix} w_H(p_1;\mathtt{i}) & w_H(p_2;\mathtt{i}) & \cdots & w_H(p_N;\mathtt{i}) \end{bmatrix} \\ \mathbf{W}_L(\mathbf{P};\mathtt{i}) &= \begin{bmatrix} w_L(p_1;\mathtt{i}) & w_L(p_2;\mathtt{i}) & \cdots & w_L(p_N;\mathtt{i}) \end{bmatrix} \end{align*}

The algorithm below computes w_H(p), w_L(p), a(p) and b(p). The equilibrium trading intensities can be derived from these values analytically. I seed initial guesses at the values of \mathbf{W}_H(\mathbf{P};\mathtt{0}) and \mathbf{W}_L(\mathbf{P};\mathtt{0}).

(18)   \begin{align*} w_H(p_n;\mathtt{0}) &= e^{10 \cdot (1 - p_n)} - 1 \\ w_L(p_n;\mathtt{0}) &= e^{10 \cdot p_n} - 1 \end{align*}

Then, I iterate on these value function guesses until the adjustment error \Gamma(\mathtt{i}) which I define in Step 5 below is sufficiently small. The estimation strategy uses the fixed point problem in Equation (13) to compute a(p) and b(p) given w_H(p) and w_L(p) and then separately uses the martingale condition in Equation (9) to compute the drift in the price level. The algorithm updates the value function in each step by first computing how badly the no trade indifference condition in Equation (15) is violated, and then lowering the values of w_H(p) for p near 1 when the high type informed trader is too eager to trade and raising them when he is too apathetic about trading and vice versa for the low type trader. Along the way, the algorithm checks that neither informed trader type has an incentive to bluff.

x-axis: Price of risky asset. Panel (a): Value function for the high (red) and low (blue) type informed trader. Panel (b): Bid (red) and ask (blue) prices for the risky asset. Panel (c): Between trade price drift.

Below I outline the estimation procedure in complete detail. Code the for the simulation can be found on my GitHub site.

\mathtt{while} (\Gamma(\mathtt{i}) > \mathtt{tol}) \ \{

Step 1. Numerically compute w_H'(p_n;\mathtt{i}) and w_L'(p_n;\mathtt{i}) at each point.

(19)   \begin{align*} w_H'(p_n;\mathtt{i}) &= \frac{1}{2} \cdot \left( \frac{w_H(p_{n+1};\mathtt{i}) - w_H(p_n;\mathtt{i})}{p_{n+1} - p_n} + \frac{w_H(p_n;\mathtt{i}) - w_H(p_{n-1};\mathtt{i})}{p_n - p_{n-1}} \right) \\ w_L'(p_n;\mathtt{i}) &= \frac{1}{2} \cdot \left( \frac{w_L(p_{n+1};\mathtt{i}) - w_L(p_n;\mathtt{i})}{p_{n+1} - p_n} + \frac{w_L(p_n;\mathtt{i}) - w_L(p_{n-1};\mathtt{i})}{p_n - p_{n-1}} \right) \end{align*}

I fill in each of the boundary derivatives manually.

(20)   \begin{align*} w_H'(0;\mathtt{i}) &= w_L'(1;\mathtt{i}) = \infty \\ w_H'(1;\mathtt{i}) &= w_L'(0;\mathtt{i}) = 0 \end{align*}

Step 2. Solve for bid and ask prices using Equation (13).

(21)   \begin{align*} a(p_n;\mathtt{i}) &= \arg_a \left\{ w_H(p_n;\mathtt{i}) = \left(1 - a\right) - w_H(a;\mathtt{i})  \right\} \\ b(p_n;\mathtt{i}) &= \arg_b \left\{ w_L(p_n;\mathtt{i}) = b - w_L(b;\mathtt{i})  \right\} \end{align*}

I interpolate the value function levels at w_H(a;\mathtt{i}) and w_L(b;\mathtt{i}) linearly. Let p_n be the closest price level to a such that a > p_n and let p_m be the closest price level to b such that p_m > b.

(22)   \begin{align*} w_H(a;\mathtt{i}) &= w_H(p_n;\mathtt{i}) + w_H'(p_n;\mathtt{i}) \cdot \left\{ a - p_n \right\} \\ w_L(a;\mathtt{i}) &= w_L(p_m;\mathtt{i}) + w_L'(p_m;\mathtt{i}) \cdot \left\{ p_m - b \right\} \end{align*}

Step 3. Compute \mu(p_n;\mathtt{i}) using Equation (9).

(23)   \begin{align*} 0 &= \mu(p_n;\mathtt{i}) + \lambda_a(p_n;\mathtt{i}) \cdot \left\{ a(p_n;\mathtt{i}) - p_n \right\} + \lambda_b(p_n;\mathtt{i}) \cdot \left\{ b(p_n;\mathtt{i}) - p_n \right\} \end{align*}

I then plug in Equation (10) to compute lambda_a(p_n;\mathtt{i}) and \lambda_b(p_n;\mathtt{i}).

(24)   \begin{align*} \lambda_a(p_n;\mathtt{i}) &= p_n \cdot \theta_{H,B}(p_n;\mathtt{i}) + \beta \\ \lambda_b(p_n;\mathtt{i}) &= (1 - p_n) \cdot \theta_{L,S}(p_n;\mathtt{i}) + \beta \end{align*}

I then use Equation (7) to solve for \theta_{H,B}(p_n;\mathtt{i}) and \theta_{L,S}(p_n;\mathtt{i}) in terms of only prices.

(25)   \begin{align*} \theta_{H,B} ( p_n;\mathtt{i})  &= \frac{\beta \cdot \left\{ p_n - a(p_n;\mathtt{i}) \right\}}{p_n \cdot \left( a(p_n;\mathtt{i}) - 1 \right)} \\ \theta_{L,S} (p_n;\mathtt{i}) &= \frac{\beta \cdot \left\{ p_n - b(p_n;\mathtt{i}) \right\}}{( 1 - p_n ) \cdot b(p_n;\mathtt{i})} \end{align*}

Combining these equations leaves a formulation for \mu(p_n;\mathtt{i}) which contains only prices.

(26)   \begin{align*} \mu(p_n;\mathtt{i}) &= \left( (1 - p_n) \cdot \theta_{L,S}(p_n;\mathtt{i}) + \beta \right) \cdot \left\{ p_n - b(p_n;\mathtt{i}) \right\} \\ &\qquad \qquad - \left( p_n \cdot \theta_{H,B}(p_n;\mathtt{i}) + \beta \right) \cdot \left\{ a(p_n;\mathtt{i}) - p_n \right\} \\ &= \left( \frac{\beta \cdot \left\{ p_n - b(p_n;\mathtt{i}) \right\}}{b(p_n;\mathtt{i})} + \beta \right) \cdot \left\{ p_n - b(p_n;\mathtt{i}) \right\} \\ &\qquad \qquad - \left(\frac{\beta \cdot \left\{ p_n - a(p_n;\mathtt{i}) \right\}}{a(p_n;\mathtt{i}) - 1} + \beta \right) \cdot \left\{ a(p_n;\mathtt{i}) - p_n \right\} \\ &= \frac{\beta \cdot p_n \cdot \left\{ p_n - b(p_n;\mathtt{i}) \right\}}{b(p_n;\mathtt{i})} - \frac{\beta \cdot \left( 1 - p_n \right) \cdot \left\{ a(p_n;\mathtt{i}) - p_n \right\}}{1 - a(p_n;\mathtt{i})} \end{align*}

Step 4. At each p_n for n \in N, set \alpha = 0.10 and ensure that Equation (14) is satisfied. If the high type informed traders want to sell at price p_n, increase their value function at price p_n by \alpha = 10\%.

(27)   \begin{align*} &\mathtt{if} \Big[ w_H(p_n;\mathtt{i}) < \left(  b(p_n;\mathtt{i}) - 1 \right) + w_H \left( b(p_n;\mathtt{i});\mathtt{i}\right) \Big] \ \{ \\ &\qquad \qquad \mu(p_n;\mathtt{i}) = \left( 1 + \alpha \right) \cdot \mu(p_n;\mathtt{i}) \\ &\} \end{align*}

If the low type informed traders want to buy at price p_n, decrease their value function at price p_n by \alpha = 10\%.

(28)   \begin{align*} &\mathtt{if} \Big[ w_L(p_n;\mathtt{i}) < -a(p_n;\mathtt{i}) + w_L \left( a(p_n;\mathtt{i});\mathtt{i} \right) \Big] \ \{ \\ &\qquad \qquad \mu(p_n;\mathtt{i}) = \left( 1 - \alpha \right) \cdot \mu(p_n;\mathtt{i}) \\ &\} \end{align*}

Step 5. Update w_H(p_n;\mathtt{i}) and w_L(p_n;\mathtt{i}) by adding \varsigma = 5\% times the between trade indifference error from Equation (15).

(29)   \begin{align*} w_H(p_n;\mathtt{i+1}) &= w_H(p_n;\mathtt{i}) + \varsigma \cdot \left\{w_H'(p_n;\mathtt{i}) \cdot \mu(p_n;\mathtt{i})  - \kappa \cdot w_H(p_n;\mathtt{i}) \right\} \\ &\qquad \qquad + \varsigma \cdot \beta \cdot \left\{ w_H\left( a(p_n;\mathtt{i});\mathtt{i} \right) + w_H\left( b(p_n;\mathtt{i});\mathtt{i} \right) - 2 \cdot w_H(p_n;\mathtt{i}) \right\} \\ w_L(p_n;\mathtt{i+1}) &= w_L(p_n;\mathtt{i}) + \varsigma \cdot \left\{w_L'(p_n;\mathtt{i}) \cdot \mu(p_n;\mathtt{i})  - \kappa \cdot w_L(p_n;\mathtt{i}) \right\} \\ &\qquad \qquad + \varsigma \cdot \beta \cdot \left\{ w_L\left( a(p_n;\mathtt{i});\mathtt{i} \right) + w_L\left( b(p_n;\mathtt{i});\mathtt{i} \right) - 2 \cdot w_L(p_n;\mathtt{i}) \right\} \end{align*}

Step 6. Evaluate update error.

(30)   \begin{align*} \Gamma(\mathtt{i}) &= \sqrt{ \frac{1}{N} \cdot \left\{ \sum_{n=1}^N \left(w_L(p_n;\mathtt{i+1}) - w_L(p_n;\mathtt{i}) \right)^2 + \sum_{n=1}^N \left(w_H(p_n;\mathtt{i+1}) - w_H(p_n;\mathtt{i}) \right)^2 \right\} } \end{align*}

\}