Mingze Gao

Probability of Informed Trading (PIN)

| 7 min read
Tags:
Translation is available:

In the market microstructure literature, Easley et. al. (1996) proposed a trading model that can decompose the bid-ask spread. The most commendable aspect of this model is the introduction of the "Probability of Informed Trading," or PIN, which serves as a means of measuring the informational component in the spread. As the name suggests, under ideal conditions, PIN can reflect the probability of informed trading in a market with market maker. In this article, I attempt to comb through the modeling process in the Easley et. al. (1996) paper and discuss how to handle the objective function in maximum likelihood estimation to avoid overflow errors during computation.

Table of Contents

Model

Assume that the buy and sell orders of informed and uninformed traders follow independent Poisson processes, and the following tree diagram describes the entire trading process:

theoretical-model-of-pin

Trading Process

Next, assume that the market maker is a Bayesian, that is, he will update his understanding of the overall market status, especially whether there is new information on that day, by observing trades and trading rates. Suppose each trading day is independent, P(t)=(Pn(t),Pb(t),Pg(t))P(t)=(P_n(t), P_b(t), P_g(t)) is the market maker's prior probability perception, where nn represents no new information, bb represents bearish bad news, and gg represents bullish good news, so P(t)=(1āˆ’Ī±,Ī±Ī“,Ī±(1āˆ’Ī“))P(t)=(1-\alpha, \alpha\delta, \alpha(1-\delta)).

Let StS_t be the event of a sell order arriving at time tt, and BtB_t be the event of a buy order arriving at time tt. Also, let P(tāˆ£St)P(t|S_t) be the updated probability perception of the market maker after observing a sell order arriving at time tt based on the existing information. Then, according to Bayes' theorem, if there is no new information at time tt and the market maker observes a sell order, the posterior probability Pn(tāˆ£St)P_n(t|S_t) should be:

Pn(tāˆ£St)=Pn(t)ĪµĪµ+Pb(t)Ī¼\begin{equation} P_n(t|S_t)=\frac{P_n(t)\varepsilon}{\varepsilon+P_b(t)\mu}\end{equation}

Similarly, if there is bearish information and the market maker observes a sell order at time tt, the posterior probability Pb(tāˆ£St)P_b(t|S_t) should be:

Pb(tāˆ£St)=Pb(t)(Īµ+Ī¼)Īµ+Pb(t)Ī¼\begin{equation} P_b(t|S_t)=\frac{P_b(t)(\varepsilon+\mu)}{\varepsilon+P_b(t)\mu}\end{equation}

If there is bullish information and the market maker observes a sell order at time tt, the posterior probability Pg(tāˆ£St)P_g(t|S_t) should be:

Pg(tāˆ£St)=Pg(t)ĪµĪµ+Pb(t)Ī¼\begin{equation} P_g(t|S_t)=\frac{P_g(t)\varepsilon}{\varepsilon+P_b(t)\mu} \end{equation}

Thus, the expected zero-profit bid price at time tt on day ii should be the conditional expectation of the asset value based on historical information and observing sell order at this time, that is,

b(t)=Pn(t)ĪµViāˆ—+Pb(t)(Īµ+Ī¼)Vā€¾i+Pg(t)ĪµVā€¾iĪµ+Pb(t)Ī¼\begin{equation} b(t)=\frac{P_n(t)\varepsilon V^*_i+P_b(t)(\varepsilon+\mu)\underline{V}_i+P_g(t)\varepsilon\overline{V}_i}{\varepsilon+P_b(t)\mu} \end{equation}

Here, ViV_i is the value of the asset at the end of day ii, and let the asset value be Vā€¾i\overline{V}_i when there is positive news, Vā€¾i\underline{V}_i when there is negative news, and Viāˆ—V^*_i when there is no news, with Vā€¾i<Viāˆ—<Vā€¾i\underline{V}_i < V^*_i < \overline{V}_i.

At this point, the ask price should be:

a(t)=Pn(t)ĪµViāˆ—+Pb(t)ĪµVā€¾i+Pg(t)(Īµ+Ī¼)Vā€¾iĪµ+Pg(t)Ī¼\begin{equation} a(t)=\frac{P_n(t)\varepsilon V^*_i+P_b(t)\varepsilon\underline{V}_i+P_g(t)(\varepsilon+\mu)\overline{V}_i}{\varepsilon+P_g(t)\mu}\end{equation}

Let's associate these bid and ask prices with the expected asset value at time tt. Considering that the conditional expectation of the asset value at this time is:

E[Viāˆ£t]=Pn(t)Viāˆ—+Pb(t)Vā€¾i+Pg(t)Vā€¾i\begin{equation} E[V_i|t]=P_n(t)V^*_i+P_b(t)\underline{V}_i+P_g(t)\overline{V}_i\end{equation}

we can write the above b(t)b(t) and a(t)a(t) as:

b(t)=E[Viāˆ£t]āˆ’Ī¼Pb(t)Īµ+Ī¼Pb(t)(E[Viāˆ£t]āˆ’Vā€¾i)\begin{equation} b(t)=E[V_i|t]-\frac{\mu P_b(t)}{\varepsilon+\mu P_b(t)}(E[V_i|t]-\underline{V}_i)\end{equation}
a(t)=E[Viāˆ£t]+Ī¼Pg(t)Īµ+Ī¼Pg(t)(Vā€¾iāˆ’E[Viāˆ£t])\begin{equation} a(t)=E[V_i|t]+\frac{\mu P_g(t)}{\varepsilon+\mu P_g(t)}(\overline{V}_i-E[V_i|t])\end{equation}

Thus, the bid-ask spread is a(t)āˆ’b(t)a(t)-b(t), which is:

a(t)āˆ’b(t)=Ī¼Pg(t)Īµ+Ī¼Pg(t)(Vā€¾iāˆ’E[Viāˆ£t])+Ī¼Pb(t)Īµ+Ī¼Pb(t)(E[Viāˆ£t]āˆ’Vā€¾i)\begin{equation} a(t)-b(t)=\frac{\mu P_g(t)}{\varepsilon+\mu P_g(t)}(\overline{V}_i-E[V_i|t])+\frac{\mu P_b(t)}{\varepsilon+\mu P_b(t)}(E[V_i|t]-\underline{V}_i)\end{equation}

This indicates that the bid-ask spread at time tt is actually:

The probability of a buy order being an informed trade Ɨ\times the expected loss due to the informed buyer + the probability of a sell order being an informed trade Ɨ\times the expected loss due to the informed seller

Therefore, the probability that any trade at time tt is based on asymmetric information from informed traders is the sum of these two probabilities:

PIN(t)=Ī¼Pg(t)Īµ+Ī¼Pg(t)+Ī¼Pb(t)Īµ+Ī¼Pb(t)=Ī¼(1āˆ’Pn(t))Ī¼(1āˆ’Pn(t))+2Īµ\begin{equation} PIN(t)=\frac{\mu P_g(t)}{\varepsilon+\mu P_g(t)}+\frac{\mu P_b(t)}{\varepsilon+\mu P_b(t)}=\frac{\mu(1-P_n(t))}{\mu(1-P_n(t))+2\varepsilon}\end{equation}

If no information event occurs (Pn(t)=1P_n(t)=1) or there are no informed trades (Ī¼=0\mu=0), both PINPIN and the bid-ask spread should be zero. If the probabilities of positive and negative news are equal, i.e., Ī“=1āˆ’Ī“\delta=1-\delta, the bid-ask spread can be simplified to:

a(t)āˆ’b(t)=Ī±Ī¼Ī±Ī¼+2Īµ[Vā€¾iāˆ’Vā€¾i]\begin{equation} a(t)-b(t)=\frac{\alpha\mu}{\alpha\mu+2\varepsilon}[\overline{V}_i-\underline{V}_i]\end{equation}

And our PINPIN measure is simplified to:

PIN(t)=Ī±Ī¼Ī±Ī¼+2Īµ\begin{equation} PIN(t)=\frac{\alpha\mu}{\alpha\mu+2\varepsilon}\end{equation}

Model Estimation

After the model is established, let's talk about the parameter estimation of this model. The parameters we need to estimate, Īø=(Ī±,Ī“,Īµ,Ī¼)\theta=(\alpha, \delta, \varepsilon, \mu), are actually very difficult to estimate. This is because we cannot directly observe them, and can only observe the arrival of buy and sell orders. In this model, the daily buy and sell orders are assumed to follow one of the three Poisson processes. Although we don't know which process it is specifically, the overall idea is: more buy orders imply potential good news, more sell orders imply potential bad news, and overall buying and selling will decrease when there is no new information. With this idea in mind, we can try to estimate Īø\theta using the maximum likelihood estimation method.

First, according to the trading model shown in the diagram, assume that there is bad news on a certain day, then the arrival rate of sell orders is (Ī¼+Īµ)(\mu+\varepsilon), which means both informed and uninformed traders participate in selling. The arrival rate of buy orders is Īµ\varepsilon, that is, only uninformed traders will continue to buy. Therefore, the probability of observing a sequence of trades with BB buy orders and SS sell orders in a period of time is:

eāˆ’ĪµĪµBB!eāˆ’(Ī¼+Īµ)(Ī¼+Īµ)SS!\begin{equation} e^{-\varepsilon} \frac{\varepsilon^B}{B!} e^{-(\mu+\varepsilon)} \frac{(\mu+\varepsilon)^S}{S!}\end{equation}

If there is good news on a certain day, the probability of observing a sequence of trades with BB buy orders and SS sell orders in a period of time is:

eāˆ’ĪµĪµBB!eāˆ’ĪµĪµSS!\begin{equation} e^{-\varepsilon} \frac{\varepsilon^B}{B!} e^{-\varepsilon} \frac{\varepsilon^S}{S!}\end{equation}

If there is no new information on a certain day, the probability of observing a sequence of trades with BB buy orders and SS sell orders in a period of time is:

eāˆ’(Ī¼+Īµ)(Ī¼+Īµ)BB!eāˆ’ĪµĪµSS!\begin{equation} e^{-(\mu+\varepsilon)} \frac{(\mu+\varepsilon)^B}{B!} e^{-\varepsilon} \frac{\varepsilon^S}{S!}\end{equation}

So, the probability of observing a total of BB buy orders and SS sell orders on a trading day should be the weighted average of the above three possibilities, and the weights here are the probabilities of each possibility. Therefore, we can write out the likelihood function:

L((B,S)āˆ£Īø)=Ā (1āˆ’Ī±)eāˆ’ĪµĪµBB!eāˆ’ĪµĪµSS!Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā +Ī±Ī“Ā eāˆ’ĪµĪµBB!eāˆ’(Ī¼+Īµ)(Ī¼+Īµ)SS!Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā Ā +Ī±(1āˆ’Ī“)eāˆ’(Ī¼+Īµ)(Ī¼+Īµ)BB!eāˆ’ĪµĪµSS!\begin{align} L((B, S)| \theta)=Ā  &(1-\alpha)e^{-\varepsilon} \frac{\varepsilon^B}{B!} e^{-\varepsilon} \frac{\varepsilon^S}{S!} \\ Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā &+ \alpha\deltaĀ  e^{-\varepsilon} \frac{\varepsilon^B}{B!} e^{-(\mu+\varepsilon)} \frac{(\mu+\varepsilon)^S}{S!} \\ Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  &+ \alpha(1-\delta) e^{-(\mu+\varepsilon)} \frac{(\mu+\varepsilon)^B}{B!} e^{-\varepsilon} \frac{\varepsilon^S}{S!} \end{align}

Hence, the objective function of the maximum likelihood function is:

L(Dāˆ£Īø)=āˆi=1NL(Īøāˆ£(Bi,Si))\begin{equation} L(D|\theta)=\prod_{i=1}^{N}L(\theta|(B_i, S_i)) \end{equation}

Bottomline

The problem seems to end here. With the objective function, it seems to be all set as long as you program it and pay attention to the parameter boundaries. However, the real challenge comes next, because if you really write the objective function like this and run it, you will inevitably encounter an overflow error. After all, this function is filled with powers and factorials. Even if the time element is chosen very small, some highly liquid assets will still have hundreds of transactions within a few seconds. Therefore, both B!B!, S!S!, and (Ī¼+Īµ)B(\mu+\varepsilon)^B can beautifully crash your program. So, further processing of the objective function here is extremely important.

By observing equation (16), the three terms in the likelihood function can actually extract a common factor eāˆ’2Īµ(Ī¼+Īµ)B+S/(B!S!)e^{-2\varepsilon}(\mu+\varepsilon)^{B+S}/(B!S!)! After extracting this common factor, you can also substitute xā‰”ĪµĪ¼+Īµāˆˆ[0,1]x\equiv \frac{\varepsilon}{\mu+\varepsilon}\in [0, 1] into it. The transformed likelihood function, after taking the logarithm, will be in the form:

l((B,S)āˆ£Īø)=lnā”(L((B,S)āˆ£Īø))=āˆ’2Īµ+(B+S)lnā”(Ī¼+Īµ)+lnā”((1āˆ’Ī±)xB+S+Ī±Ī“eāˆ’Ī¼xB+Ī±(1āˆ’Ī“)eāˆ’Ī¼xS)āˆ’lnā”(B!S!)\begin{align} l((B, S)| \theta)=&\ln(L((B, S)| \theta))\\ &=-2\varepsilon+(B+S)\ln(\mu+\varepsilon) \\ &+\ln((1-\alpha)x^{B+S}+\alpha\delta e^{-\mu}x^B + \alpha(1-\delta)e^{-\mu}x^S) \\ &-\ln(B!S!) \end{align}

Now, since the last term lnā”(B!S!)\ln(B!S!) does not affect the parameter estimation at all, it can be safely excluded. The remaining part can perfectly avoid overflow. Personally, I think the brilliant move here is the introduction of xā‰”ĪµĪ¼+Īµāˆˆ[0,1]x\equiv \frac{\varepsilon}{\mu+\varepsilon}\in [0, 1], which prevents the overflow error caused by (Ī¼+Īµ)>1(\mu+\varepsilon)>1.


Tags: