modelling limit order book dynamics using poisson and

24
Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References Modelling Limit Order Book Dynamics Using Poisson and Hawkes Processes Yuanda Chen Major Advisor: Dr. Alec N. Kercheval Department of Mathematics Florida State University May 22, 2013 Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 1/ 24

Upload: others

Post on 18-Dec-2021

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Modelling Limit Order Book Dynamics UsingPoisson and Hawkes Processes

Yuanda ChenMajor Advisor: Dr. Alec N. Kercheval

Department of MathematicsFlorida State University

May 22, 2013

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 1/ 24

Page 2: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Outline

1 Introduction

2 Poisson processes

3 Modelling order book dynamics

4 Hawkes processes

5 Future Research

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 2/ 24

Page 3: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Introduction

1 From quote-driven to order-driven markets.

2 Aggregates all outstanding orders in a limit order book.

3 A limit order sits in the order book until it is either executed againsta market order or canceled.

4 Three things can happen:

(a) new order added(b) existing order executed against market orders(c) existing order canceled

5 High frequency trading and data make modelling at transactionlevel possible.

6 Irregular occurrence suggests using of point processes.

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 3/ 24

Page 4: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Poisson Processes

Counting processes

Definition (Point processes)

Let (Ω,F,P) be a probability space. Let tii=0,1,2,... be a sequence ofnon-negative random variables such that for all i , ti < ti+1 and ti →∞a.s.. We call ti a point process on R+.

Definition (Counting processes)

The right-continuous process

N(t) =∑

i=0,1,2,...

1ti≤t <∞

a.s. is called the counting process associated with tii=0,1,2,....

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 4/ 24

Page 5: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Poisson Processes

Counting process

A counting process satisfies:

1 N(t) ≥ 0.

2 N(t) is integer valued.

3 If s < t, then N(s) ≤ N(t).

4 For s < t, N(t) − N(s) is the number of occurrence in (s, t].

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 5/ 24

Page 6: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Poisson Processes

Poisson processes

Definition (Poisson processes)

The counting process N(t), t ≥ 0 is said to be a Poisson process with rateλ, λ > 0, if

(i) N(0) = 0.

(ii) The process has independent increments.

(iii) The number of events in any interval of length t is Poisson distributedwith mean λt. That is for all s, t ≥ 0

PN(t + s)− N(s) = n = e−λt (λt)n

n!, n = 0, 1, . . . .

Proposition

The interarrival times Tn, n = 1, 2, . . . for a Poisson process, are independentidentically distributed exponential random variables with mean 1/λ.

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 6/ 24

Page 7: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Poisson Processes

Poisson processes

Definition

The function f is said to be o(h) if limh→0f (h)h = 0.

Proposition

The counting process N(t), t ≥ 0 is a Poisson process with rateλ, λ > 0, if and only if

(i) N(0) = 0.

(ii) The process has stationary and independent increments.

(iii) PN(h) = 1 = λh + o(h).

(iv) PN(h) ≥ 2 = o(h).

as h→ 0.

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 7/ 24

Page 8: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Framework

State of the order book

Consider a price grid 1, 2, . . . , n of a range of prices at integer multiplesof a price tick, out of which prices are unlikely to appear for a shortperiod. At a given time t, the state of the order book is defined as avector associating with the number of outstanding limit orders at eachprice on the grid:

X (t) = (X1(t),X2(t), . . . ,Xn(t))

where |Xp(t)| is the number of outstanding limit orders at price

corresponding to p on the price grid. If Xp(t) < 0 then it means that

there are −Xp(t) buy orders at price p; if Xp(t) > 0, then there are Xp(t)

sell orders at price p.

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 8/ 24

Page 9: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Framework

State of the order book

Some crucial variable can be derived from the state of the order book.

(i) The ask price, or the best sell price,pA(t) = infp = 1, . . . , n,Xp(t) > 0

∧(n + 1).

(ii) The bid price, or the best buy price,pB(t) = supp = 1, . . . , n,Xp(t) < 0

∨0.

(iii) The mid-price, pM(t) = pB (t)+pA(t)2

.

(iv) The bid-ask spread, pS(t) = pA(t)− pB(t).

(v) The number of buy orders at a distance i from the ask,

QBi (t) =

XpA(t)−i (t) 0 < i < pA(t)0 pA(t) ≤ i < n

(vi) The number of sell orders at a distance i from the bid,

QAi (t) =

XpB (t)+i (t) 0 < i < n − pB(t) + 10 n − pB(t) ≤ i < n

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 9/ 24

Page 10: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Framework

Modelling Dynamics

Assumptions

All three events that can happen to the order book are assumed to bemutually independent, with arrival times modelled as Poisson processeswith different rates:

1 Incoming limit orders: λ(i) which has the form λ(i) = k/iα.

2 Incoming market orders: a constant µ.

3 Cancellation of limit orders: θ(i)x , proportional to the number ofoutstanding orders x .

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 10/ 24

Page 11: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Framework

Modelling Dynamics

If we define xp±1 = x ± (0, . . . , 1, . . . , 0) where the 1 is at the pthcomponent, then the transition of the state can be expressed as:

x → xp−1: incoming limit buy order with rate λ(pA(t)− p) for p < pA(t).x → xp+1: incoming limit sell order with rate λ(p− pB(t)) for p > pB(t).x → xpA(t)−1: execution of best sell order with rate µ.x → xpB (t)+1: execution of best buy order with rate µ.x → xp−1: cancellation of sell order with rate θ(pA(t)− p)|xp| forp < pA(t).x → xp+1: cancellation of buy order with rate θ(p − pB(t))|xp| forp > pB(t).

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 11/ 24

Page 12: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Intensity Function

Intensity Function

Definition (Intensity function)

Let N be a counting process adapted to a filtration Ft . Theleft-continuous conditional intensity function is defined as (Daley 2003)

λ(t|Ft) = limh→0

1

hPN(h + t)− N(t) > 0|Ft.

Poisson processes revisited

limh→0

1

hPN(t + h)− N(t) > 0 = lim

h→0

λ(t)h + o(h)

h= λ(t).

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 12/ 24

Page 13: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Hawkes Processes

Definition

A univariate self-excited process N(t) is given by allowing the intensityitself be stochastic, characterized using the following Stieltjes integral(Hawkes 1971)

λ(t) = ν +

∫ t

−∞γ(t − u)dNu = ν +

∑ti<t

γ(t − ti ), (1)

where ν > 0 is called the base intensity and γ(t) > 0 the excitationkernel such that

0 < m =

∫ ∞0

γ(u)du < 1. (2)

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 13/ 24

Page 14: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Hawkes Processes

Definition

Definition

A simple version of Hawkes process λ(t) is defined by using a constantbase intensity and an exponential kernel γ(t) = αe−βt :

(i) N(0) = 0.

(ii) λ(t) = ν + α∫ t

0e−β(t−s)dNs = ν + α

∑ti<t e

−β(t−ti ).

(iii) PN(t + h)− N(t) = 1|Ft = λ(t)h + o(h).

(iv) PN(t + h)− N(t) ≥ 2|Ft = o(h).

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 14/ 24

Page 15: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Hawkes Processes

Existence and Uniqueness

Lemma (Existence)

If ν > 0 and m < 1 there exists a stationary Poisson cluster process withrate λ = ν/(1−m) satisfying (1) and (2).

Lemma (Uniqueness)

There exists at most one stationary orderly point process of finite ratewhose complete intensity is given by (1) and (2).

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 15/ 24

Page 16: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Hawkes Processes

Poisson Cluster Processes

Definition (Poisson cluster processes)

A Poisson cluster process X ⊂ R is a point process such that:

(a) The immigrants (cluster centers) are distributed according to ahomogeneous Poisson process I with points Xi ∈ R and intensity ν > 0.

(b) Each immigrant Xi generates a cluster Ci which is a finite point process(i.e., it has a finite number of points almost surely) containing Xi .

(c) Given the immigrants, the centered clusters

Ci − Xi = Y − Xi : Y ∈ Ci,Xi ∈ I

are iid and independent of I .

(d) X consists of the union of all clusters.

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 16/ 24

Page 17: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Hawkes Processes

Existence and Uniqueness

Theorem

Hawkes (1974) If ν > 0 and the non-negative function γ(u) satisfies

0 < m =

∫ ∞0

γ(u)du < 1

then there is precisely one stationary orderly process of finite rate whosecomplete intensity function satisfies (1).

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 17/ 24

Page 18: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Simulation

Sample Path

Figure: An Example of the Intensity of a Hawkes Process(ν = 1.2,α = 0.6,β = 0.8)

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 18/ 24

Page 19: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Simulation

Thinning Algorithm

The original thinning algorithm was developed by Lewis (1978) forsimulating inhomogeneous Poisson processes with rate λ(t).

1 Choose a constant λ∗ such that λ∗ ≥ λ(t) for all t.

2 Generate a homogeneous Poisson process with rate λ∗.

3 Accept with probability λ(·)/λ∗(·).

Ogata (1981) modified this algorithm to generate Hawkes processes.

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 19/ 24

Page 20: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Simulation

Modified Thinning Algorithm

Algorithm

1. Set n=0 and s=0 and set t0 = s = 0.

2. Repeat until s > T .

(i) Compute m(s) = λ(s|t1, . . . , tn) + α if s was accepted as some tiand m(s) = λ(s|t1, . . . , tn) if s was rejected. This is the rate atwhich we generate the next point as if we are generating a Poissonprocess.

(ii) Generate an independent exponential random variable ∆s withmean 1/m(s). Then s + ∆s is the next point waiting to beaccepted/rejected.

(iii) Generate an independent uniform random variable D and accepts + ∆s by letting n = n + 1 and tn = s + ∆s ifD ≤ λ(s + ∆s|t1, . . . , tn)/m(s); otherwise, reject s + ∆s.

(vi) Set s = s + ∆s.

3. Output t0, t1, . . . , tn as the occurrence times of the Hawkes process.

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 20/ 24

Page 21: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Simulation

Residual Analysis

1 Published in (Ogata 1988).

2 Test how well the Hawkes process with know parameters fits thedata.

3 Define the compensator: Λ(t) =∫ t

0λ(u)du.

4 Λ(ti )− Λ(ti−1), i = 2, . . . , n are i.i.d. exponential random variableswith mean 1 (Daley 2003).

5 In our case,

Λ(ti ) =

∫ ti

0

λ(u)du

=

∫ ti

0

(ν +∑j :tj<u

ae−b(u−tj ))du

= νti +a

b

∑j :tj<u

(1− e−b(ti−tj ))

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 21/ 24

Page 22: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Simulation

Residual Analysis

Figure: Residual Analysis of Simulated Hawkes/Poisson Process on [0, 1000]

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 22/ 24

Page 23: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

Future Research

1 Run simulations

2 Prove propositions

3 Analytical solution

4 ...

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 23/ 24

Page 24: Modelling Limit Order Book Dynamics Using Poisson and

Outline Introduction Modelling Order Book Dynamics Hawkes Processes Future Research References

References

1 Bauwens, L., Hautsch, N. 2003. Dynamic latent factor models for intensity processes. ECON DiscussionPapers; 2003/103.

2 Bordenave, C., Torrisi, G. L. 2007. Large Deviations of Poisson Cluster Processes. Stochastic Models;23:593-625, 2007.

3 Cont, R., Stoikov, S., Talreja, R. 2010. A Stochastic Model for Order Book Dynamics. OperationsResearch Vol. 58, No. 3, MayCJune 2010, pp. 549C563.

4 Daley, D. J., Vere-Jones, D. 2003. An Introduction to the Theory of Point Processes, Volume I:Elementary Theory and Methods. Springer, New York, 2nd edition.

5 Hawkes, A. G. 1971. Spectra of some self-exciting and mutually exciting point processes. Biometrica, 58,83.

6 Hawkes, A. G., Oakes, D. 1974. A Cluster Process Representation of a Self-Exciting Process. Journal ofApplied Probability Vol. 11, No. 3 (Sep., 1974), pp. 493-503

7 Lewis, P., A., W., Shedler, G., S. 1978. Simulation of nonhomogeneous poisson processes by thinning.Naval Research Logistics Quarterly 08/1979; 26(3):403 - 413. DOI:10.1002/nav.3800260304

8 Ogata, Y. 1981. On lewis’ simulation method for point processes. IEEE information theory, vol. it-27, pp.23-31.

9 Ogata, Y. 1988. Statistical Models for Earthquake Occurrences and Residual Analysis for Point Processes.Journal of the American Statistical Association, vol. 83, issue 401.

10 Ross, S. 2010. Introduction to Probability Models. Elsevier. ISBN: 978-0-12-375686-2.

Yuanda Chen PhD Candidacy Examination May 22, 2013 Slide 24/ 24