Ioane Muni Toke
email: ioane.muni-toke@centralesupelec.fr

Nakahiro Yoshida
email: nakahiro@ms.u-tokyo.ac.jp

Analyzing order flows in limit order books with ratios of Cox-type intensities

Keywords: order book models, point processes, Cox processes, Hawkes processes, ratio models, trading signals, imbalance, spread

Analyzing order flows in limit order books with ratios of Cox-type intensities

Ioane Muni Toke, Nakahiro Yoshida

Introduction

The limit order book is the central structure that aggregates all orders submitted by market participants to buy or sell a given asset on a financial market. Buy offers form the bid side, sell offers form the ask side. Simplified representations of possible interactions with a limit order book usually consider three archetypal sorts of orders : limit orders, market orders, and cancellations. Buy (resp. sell) limit orders are orders to buy (resp. sell) a given quantity of the asset with a given limit price strictly lower (resp. greater) than the current best ask (resp. bid) quote. Limit orders are stored in the book until matched or canceled. Buy (resp. sell) market orders are submitted without any limit price, and are thus matched against the current best ask (resp. bid) orders. Cancellations remove a non-executed limit order from the book.

The rise of electronic markets, the accelerating rate of trading on financial markets, the development of optimal trading strategies by brokers, etc., have pushed for better investigation and modeling of limit order books. [START_REF] Chakraborti | Econophysics review: I. Empirical facts[END_REF], [START_REF] Gould | Limit order books[END_REF] and [START_REF] Abergel | Limit order books[END_REF] provide some overview on recent modeling efforts. [START_REF] Cont | A stochastic model for order book dynamics[END_REF] has been a seminal model using Poisson processes. [START_REF] Huang | Simulating and analyzing order book data: The queue-reactive model[END_REF] investigate Markovian dynamics dependent on the size of the queues of the limit order book. Muni [START_REF] Toke | Modelling intensities of order flows in a limit order book[END_REF] propose a statedependent model that makes orders intensities depend on financial signals such as the bid-ask spread. A common difficulty in estimating these models is the necessity to cope with the fact that market activity is highly fluctuating during the day, at all timescales. Daily market activity (for example measured in number or volume of trades, or in number or volume of all orders) is known to globally exhibit a U-shaped pattern, with a lower activity in the middle of the day, and a much higher activity in the morning after the market opening, and in the afternoon before market close. This seasonality effect is non-smooth: exogenous news (announcements of company results, of acquisitions, of macroeconomic indicators, etc.) occur all day long, at random or predetermined times, and may incur activity bursts. In Europe, openings of American markets are usually followed by some activity increase. It may be quite difficult to incorporate such variations in a model.

In order to avoid such problems, one may try to remove the most hectic parts of the samples, and/or focus on a limited time interval, and/or split trading days in several parts. Examples can be found in, e.g., the growing literature on Hawkes processes in finance: [START_REF] Bacry | Non-parametric kernel estimation for symmetric Hawkes processes. Application to high frequency financial data[END_REF] limits tests on their estimation procedure to two-hour periods to avoid seasonality effects; [START_REF] Lallouache | The limits of statistical significance of Hawkes processes fitted to financial data[END_REF] uses time-dependent piecewise-linear baseline intensity (with nodes spaced every few hours). However, even at these scales, global market activity varies and may limit the reliability of estimation procedures.

In this work we continue previous investigations on the influences of financial variables (state of the order book or other trading signals) on the processes of order submissions. We assume that orders submissions are modeled by point processes with Cox-like intensities depending on given covariates. However, we do not directly try to model and fully estimate each and every intensities of the model, as in e.g. Muni [START_REF] Toke | Modelling intensities of order flows in a limit order book[END_REF], but we rather try to estimate the relative influences of given covariates on the intensities. To this end we assume that their exists a possibly random baseline intensity that is common to all processes under investigation, and that could for example incorporate the seasonality effects and changing activities that we have described. By dealing with ratios of intensities, we can then remove this baseline intensity from our estimation procedure, and thereby obtain a model that focuses only on the financial covariates under investigation.

In Section 2 we describe the general model of ratios of intensities. In Section 3 we show that the quasi-likelihood estimators of the model are consistent and asymptotically normal. Section 4 discusses the method with respect to information criteria and penalization. Finally, Section 5 illustrates the benefits of the model with several examples of limit order book analysis. The ratio model is able to reproduce empirical observations on trading signals in orders flows such as imbalance, spread, quantities available, etc. Estimation results on more than 30 stocks in the Paris Stock Exchange for most of the year 2015 show a very good agreement between empirical observations and the proposed ratio model.

Model description

Let I = {0, . . . , ī} and J = {1, . . . , j} for some strictly positive integers ī and j. Let (N i t ) t≥0 , i ∈ I, be some counting processes. We assume that the intensities λ i (t), i ∈ I, of these counting processes share a common baseline intensity λ 0 (t). λ 0 (t) is neither observable nor specified as a function of observables and parameters. For any i ∈ I, the intensity λ i (t) is written :

λ i (t, ϑ) = λ 0 (t) exp   j∈J ϑ i j X j (t)   , (1)
where (X j (t)) t≥0 is the j-th observable covariate process and ϑ = (ϑ i j ) i∈I,j∈J a parameter vector. We are not interested in the value of the coefficient ϑ i j , modeling the specific response of the counting process N i to the covariate X j , but rather in the relative responses of the intensities compared to each other. Let

θ i j = ϑ i j -ϑ 0 j , (i ∈ I, j ∈ J) (2)
be the relative response of process i compared to process 0 with respect to covariate j, j ∈ J.

Obviously, ∀j ∈ J, θ 0 j = 0 since the process 0 is taken as an arbitrary reference, and ∀j ∈ J, ∀(i, i ) ∈ I 2 , θ i j -θ i j = ϑ i j -ϑ i j , i.e. the differences between absolute and relative responses are equal. Instead of the standard intensities defined at Equation (1), and since we are only interested in the relative responses, we will consider the intensities ratios

r i (t, θ) = λ i (t, ϑ) i ∈I λ i (t, ϑ) (3)
where θ = (θ 1 1 , . . . , θ 1 j , . . . , θ ī 1 , . . . , θ ī j ) denotes the new parameter vector. Notation is justified by the following computation:

r i (t, θ) = exp j∈J ϑ i j X j (t) i ∈I exp j∈J ϑ i j X j (t) =   exp   - j∈J ϑ i j X j (t)   i ∈I exp   j∈J ϑ i j X j (t)     -1 =   i ∈I exp   j∈J (ϑ i j -ϑ i j )X j (t)     -1 =   i ∈I exp   j∈J (θ i j -θ i j )X j (t)     -1 =   1 + i ∈I\{i} exp   j∈J (θ i j -θ i j )X j (t)     -1 . ( 4
)
As hinted in the introduction, this framework is convenient to model a limit order book since daily movements are known to exhibit both intraday seasonality and sudden bursts of activities, sometimes in response to exogenous news, sometimes occurring for reasons less obvious to the outside observer. If we assume that such global market activity equally affects all types of orders, then such variations of market activity are taken into account by the non specified, possibly stochastic, baseline intensity λ 0 . Therefore, we can estimate relative responses θ of order flows to specific covariates without having to account for the common intensity λ 0 due to global market activity. If different patterns of background intensities are observed in the data, then it is possible to incorporate these differences into covariates.

One should also note that by construction i∈I r i (t, θ) = 1. This gives another important feature of the model, which is that the intensities ratios r i are directly interpretable in terms of probability. Let us assume that the counting process N i , i ∈ I, are counting the number of events of (mutually exclusive) type i occurring in the limit order book. Then the intensities ratio r i is the instantaneous probability that the next occurring event will be of type i. Our ratio model can thus estimate relative event probabilities independently of the variations of market activity that are assumed to be shared by the intensities of all processes. Several examples are provided in Section 5.

Likelihood analysis

In this section, we show that the quasi-maximum likelihood estimator and the quasi-Bayesian estimator of the ratio model of Equation ( 3) are consistent and asymptotically normal. Two close formulations are provided. In the first one, stationarity of covariates is assumed to obtain consistency and asymptotic normality. In the second one, this assumption is discarded, but it is assumed that the sample consists of repeated i.i.d. measurements to again obtain consistency and asymptotic normality. This second formulation is in agreement with the common practice in empirical finance to glue several trading days, or parts of trading days, into one single sample.

Let us introduce some notations used in the following analysis. For a tensor T = (T i 1 ,...,i k ) i 1 ,...,i k , we write

T[u 1 , ..., u k ] = T[u 1 ⊗ • • • ⊗ u k ] = i 1 ,...,i k T i 1 ,...,i k u i 1 1 • • • u i k k (5) for u 1 = (u i 1 1 ) i 1 ,..., u k = (u i k k ) i k . Brackets [ , .
.., ] stand for a multilinear mapping. We denote by u ⊗r = u ⊗ • • • ⊗ u the r times tensor product of u. Let ι(θ) = (0 j , θ), where 0 k = 0 ∈ R k . We will write λ i (t, θ) for λ i (t, ι(θ)) for notational simplicity. Furthermore we write θ i = (θ i j ) j∈J for i ∈ I. Since θ 0 = 0, we will use the notation I 0 = I \ {0} = {1, . . . , ī} and consider a bounded domain Θ ⊂ R p , with p = ī × j as the parameter space of θ = (θ i j ) i∈I 0 ,j∈J .

Case of stationary covariates

Let T ∈ R * + . To estimate θ ∈ Θ based on the observations on [0, T ], we consider the quasi-log likelihood (log partial likelihood)

H T (θ) = i∈I T 0 log r i (t, θ) dN i t . (6)
Obviously, the model is continuously extended to the closure Θ, and H T is extended to there as a continuous function. A quasi-maximum likelihood estimator (QMLE) is a measurable mapping θM

T : Ω → Θ satisfying H T ( θM T ) = max θ∈Θ H T (θ) (7)
for all ω ∈ Ω. The quasi-Bayesian estimator (QBE) with respect to a prior density is defined by

θB T = Θ exp H T (θ) (θ)dθ -1 Θ θ exp H T (θ) (θ)dθ. ( 8
)
The QBE takes values in C[Θ], the convex hull of Θ. We assume is continuous and satisfies 0 < inf θ∈Θ (θ) ≤ sup θ∈Θ (θ) < ∞. These estimators are called together quasi-likelihood estimators.

We now investigate asymptotic properties of the estimators when T → ∞ in two cases.

Let X = (X j ) j∈J . In this first step, in order to simplify the statements, we assume that the process (λ 0 , X) is stationary. Denote by θ * = ((ϑ * ) i j -(ϑ * ) 0 j ) i∈I 0 ,j∈J the true value of θ, and assume that θ * ∈ Θ. Denote by B I the σ-field generated by {λ 0 (t), X(t); t ∈ I} for I ⊂ R + . Let

α(h) = sup t∈R + sup A∈B [0,t] ,B∈B [t+h,∞) P [A ∩ B] -P [A]P [B] (9)
for h > 0. We consider the following conditions.

[A1] The process (λ 0 , X) is stationary,

λ 0 (0) ∈ L ∞-= ∩ p>1 L p and exp(|X j (0)|) ∈ L ∞-for all j ∈ J.
[A2] The function α is rapidly decreasing, that is, lim sup h→∞ h L α(h) < ∞ for every L > 0.

Let

ρ i (x, θ) = i ∈I exp x θ i -θ i -1 (10) for x ∈ R j and θ = (θ i ) i∈I 0 ∈ R p . Let Λ(w, x) = w i∈I exp x ϑ * i (11) for w ∈ R + and x ∈ R j . Denote by V(x, θ) the variance matrix of the (1+i)-dimensional multinomial distribution M(1; π 0 , π 1 , ..., π i ) with π i = ρ i (x, θ), i ∈ I, and V(x, θ) α,α is V(x, θ)'s (α + 1, α + 1)- element. Let V 0 (x, θ) = (V(x, θ) α,α ) α,α ∈I 0 . Define a symmetric tensor Γ by Γ[u ⊗2 ] = E V 0 (X(0)) ⊗ X(0) ⊗2 [u ⊗2 ]Λ(λ 0 (0), X(0)) (12)
for u ∈ R p , where V 0 (x) = V 0 (x, θ * ). The matrix Γ is nonnegative definite. We assume

[A3] det Γ > 0.
The non-degeneracy of Γ is a local condition. However, the global identifiability condition follows from this condition in the present model, as seen later.

Let θ * ∈ Θ denote the true value of θ. Denote by C p (R p ) the space of continuous functions on R p of at most polynomial growth. We write ûM

T = √ T θM T -θ * and ûB T = √ T θB T -θ * .
Denote by ζ a p-dimensional standard Gaussian vector. The quasi-likelihood analysis ensures convergence of moments as well as asymptotic normality of the quasi-likelihood estimators.

Theorem 3.1. Suppose that [A1], [A2] and [A3] are satisfied. Then E f (û A T ) → E f (Γ -1/2 ζ) (13)
for any f ∈ C p (R p ) and A ∈ {M, B}.

Proof is given in the appendix.

Example 1. Let H be a Hawkes process with exponential kernel with parameters (µ, α, β) ∈ (R * + ) 3 . For the sake of illustrating Theorem 3.1, we consider a version of model (1) with ī = 1, j = 1, and in which the common baseline intensity λ 0 is the intensity of the process H. We thus have:

λ i (t, ϑ) = µ + t 0 αe -β(t-s) dH(s) exp ϑ i 1 X 1 (t) , i = 0, 1, (14)
where X 1 is a Markov chain with states {-1, 1} and infinitesimal generator λ X -λ X -λ X λ X . Then we obviously have p = 1, i.e. θ = ϑ 1 1 -ϑ 0 1 is the single parameter to be fit. In this specific case, one may explicitly compute the asymptotic variance of Equation ( 12):

Γ = µ 1 -α β e θ * (1 + e θ * ) 2 cosh((ϑ * ) 1 0 ) + cosh((ϑ * ) 1 1 ) ∈ R * + . (15)
We run 1000 simulations of the model with Hawkes parameters µ = 0.5, α = 1, β = 2, covariate parameter λ X = 0.5, and horizon T = 1000. True values of the parameters are (ϑ * ) 1 1 = 0.75, (ϑ * ) 0 1 = -0.75 so that θ * = 1.5. For each simulation we estimate θ. The empirical density of the estimated values of θ -θ * is plotted on Figure 1 in dots and full line. On the same plot is provided in dashed lines a Gaussian distribution fitted on these estimated values, as well as the theoretical Gaussian distribution given by Theorem 3.1, i.e. with the asymptotic variance given at Equation (12). Experimental values agree with the results of Theorem 3.1.

Example 2. This paper does not focus on the baseline intensity. However, in the case of a parametric model where the baseline intensity is fully specified, then the ratio approach is particularly helpful as it reduces the dimension of the space of the parameters, and can thus help improving numerical estimations by choosing appropriate starting points for the optimization routines. As an illustration, let us consider a model similar to the previous example, with a Hawkes process H with k = 2 exponential kernels as baseline intensity, ī = 2, i.e. 3 processes, and j = 2 covariates (same Markov chains as in the previous example):

λ i (t, ϑ) =   1 + k k=1 t 0 α k e -β k (t-s) dH(s)   exp   j j=1 ϑ i j X j   . ( 16
)
Maximum likelihood estimators of this model are directly computable when the process H is observable. This requires an optimization on 10 parameters. As an alternative estimation procedure, we can estimate the ratio model (4 parameters θ i j , i = 1, 2, j = 1, 2) and then estimate the full model likelihood with the constraints that the differences ϑ i j -ϑ 0 j are kept equal to the estimated values θ i j (dimension 6). All 10 parameters are thus estimated. The estimated values can finally be q q q q q q q q q q q q q q q q q -0. with random starting points (using a standard Gaussian distribution). With these parameters and an horizon T = 10 000, samples have roughly 33 000 data points in average. Out of 197 tests, the "Full' estimation converged only 10 times, while the "Combined" method converged 192 times out of 202. Estimates produced by the "Combined" method are closer to the true values and have a smaller empirical standard deviations by a factor 2 to 10 (except for ϑ 2 0 , already well-estimated in the "Full" case). Strong improvements are observed in the Hawkes parameters, where the standard "Full" method struggles to produce close estimates, while the "Combined" method starting with a ratio estimation yields much more accurate results.

Repeated measurements

We complete the previous analysis with a formulation of our estimation result that may be convenient in finance and in other fields of applications. We consider a sequence of observations of intraday data. The observations may be non-ergodic each day. We shall consider intervals

I (k) = [O k , C k ] (k ∈ N) of the same length such that 0 ≤ O 1 < C 1 ≤ O 2 < C 2 ≤ • • • . We consider the counting processes N i = (N i t )
t∈R + of the previous section. However, in this section, the observations are ((

N i t ) i∈I , X(t)) t∈I (k) , k = 1, ..., T .
As before, it is assumed that the point processes N i (i ∈ I) have no common jumps. The stationarity of each process λ i (t, ϑ * ) t∈I (k) is not assumed here.

We are interested in estimation of the parameter θ = (θ i j ) i∈I 0 , j∈J defined earlier by Equation ( 2). The estimation will be based on the random field H T re-defined by

H T (θ) = T k=1 i∈I I (k) log r i (t, θ)dN i t . ( 17
)
Then the QMLE and the QBE are defined by Equations ( 7) and ( 8), respectively, but for H T given by Equation ( 17).

Let

X k = λ 0 (t), X(t) t∈I (k) . Let G k = σ[X 1 , ..., X k ] and let H k = σ[X k , X k+1 , ...]. The α-mixing coefficient for X = (X k ) k∈N is defined by α X (h) = sup k∈N sup A∈G k , B∈H k+h P [A ∩ B] -P [A]P [B] . (18)
Let us then define the new conditions.

[C1] The sequence (X k ) k∈N is identically distributed. Moreover, sup t∈I (1) λ 0 (t) p < ∞ and

max j∈J sup t∈I (1) exp(p|X j (t)|) 1 < ∞ for all p > 1. [C2] For every L > 0, lim sup h→∞ h L α X (h) < ∞.
Define the symmetric tensor Γ by

Γ[u ⊗2 ] = E I (1) V 0 (X(t)) ⊗ X(t) ⊗2 [u ⊗2 ]Λ(λ 0 (t), X(t))dt (19)
for u ∈ R p . The matrix Γ is nonnegative definite. More strongly we assume

[C3] det Γ > 0.
In a way similar to Theorem 3.1, it is possible to prove the following theorem.

Theorem 3.2. Suppose that [C1], [C2] and [C3] are satisfied. Then E f (û A T ) → E f (Γ -1/2 ζ) (20) as T → ∞ for any f ∈ C p (R p ) and A ∈ {M, B}.
The proof is omitted.

Information criteria and penalization

Since the ratio model flexibly incorporates various covariates processes and since it may have a large number of parameters, we need information criteria for model selection and other regularization methods for sparse estimation. Though the inference of the ratio model is based on the quasilikelihood analysis, we can still apply information criterion like CAIC (consistent AIC) and BIC by using H T . See [START_REF] Bozdogan | Model selection and Akaike's information criterion (AIC): The general theory and its analytical extensions[END_REF] for exposition of information criteria for model selection.

Let a T be a sequence of positive numbers such that a T → ∞ and a T /T → 0 as T → ∞. Let

K ⊂ I 0 × J. We consider a sub-model S K of Θ such that S K = {θ ∈ Θ; θ i j = 0 ((i, j) ∈ K c )}. ( 21
) Let C T (S K ) = -2H T ( θK ) + d(S K )a T ( 22
)
where θK (depending on T ) is denoting the QMLE or QBE in the sub-model S K and d(S K ) is the dimension of S K . More precisely, the QMLE θM K is defined as an estimator that satisfies

H T ( θM K ) = max θ∈S K H T (θ), (23)
and the QBE θB K is defined by

θB K = S K exp H T (θ) S K (θ) -1 S K θ exp H T (θ) S K (θ)dθ (24)
for a continuous prior density

S K on S K satisfying 0 < inf θ∈S K S K (θ) ≤ sup θ∈S K S K (θ) < ∞.
We denote by S K * the minimum model that includes θ * , in other words, (θ * ) i j = 0 if and only if (i, j) ∈ K * . The QMLE and QBE for θ restricted to the sub-model S K * are generically denoted by θK * . In particular,

C T (S K * ) = -2H T ( θK * ) + d(S K * )a T . ( 25
) Proposition 4.1. Suppose that [A1], [A2] and [A3] are satisfied. Then (i) If θ * ∈ S K , then C T (S K ) -C T (S K * ) → p ∞ (T → ∞) (26) (ii) If θ * ∈ S K and S K = S K * , then C T (S K ) -C T (S K * ) → p ∞ (T → ∞) (27)
A proof of Proposition 4.1 is given in Appendix for selfcontainedness. According to Proposition 4.1, we should select a model S K that attains min{C T (S K ); K ⊂ I 0 × J}. Then the selection consistency holds as Recently penalized quasi-likelihood analysis for sparse estimation has been developed. We consider a penalty function p λ such that p λ (x) = p λ (-x), p λ (0) = 0, p λ is non-decreasing on x ≥ 0, p λ is differentiable except for x = 0, and lim x↓0 x -q p λ (x) = λ > 0 for some q ∈ (0, 1]. This class of penalty functions includes the ones of LASSO [START_REF] Tibshirani | Regression shrinkage and selection via the lasso[END_REF]), Bridge [START_REF] Frank | A statistical view of some chemometrics regression tools[END_REF]) and SCAD [START_REF] Fan | Variable selection via nonconcave penalized likelihood and its oracle properties[END_REF]). Suppose that we have a QLA based on the random field H T . Then we have the penalized contrast function

P K = K * → 1 (T → ∞). (28
-H † T (θ) = -H T (θ) + √ T i∈I 0 ,j∈J p λ (θ i j ) (29)
and the penalized QMLE θλ (depending on T ) is associated by

θλ ∈ argmin θ∈Θ -H † T (θ) . (30)
In the case q = 1, the polynomial type large deviation inequality is inherited from H T to H † T , as a result, we obtain asymptotic properties of θλ as well as L p -boundedness of the error. Asymptotic distribution becomes slightly involved. In a similar way, in the case q < 1, it is possible to derive asymptotic properties of θλ . A prominent property is selection consistency. Thanks to the QLA theory having a polynomial type large deviation inequality, we can prove that the probability of [START_REF] Kinoshita | Penalized quasi-likelihood estimation for variable selection[END_REF] for details. An advantage of working with the QLA theory is that asymptotic properties of regularization methods are obtained in a unified manner without using any specific nature of the stochastic process. The QLA was used in [START_REF] Umezu | AIC for non-concave penalized likelihood method[END_REF] for a generalized linear model.

correct model selection is 1 -O(T -L ) as T → ∞ for every L > 0. See
Another approach is toward the adaptive LASSO [START_REF] Zou | The adaptive lasso and its oracle properties[END_REF]) and the least square approximation method [START_REF] Wang | Unified LASSO estimation by least squares approximation[END_REF]). [START_REF] Gregorio | Adaptive LASSO-type estimation for multivariate diffusion processes[END_REF] took this approach to sparse estimation of ergodic diffusions. Since we can assume strong mode of convergence for the initial estimator constructed within the QLA framework, we can obtain selection consistency with error probability that is of O(T -L ) for any L > 0 as well as the oracle properties of the penalized estimator. For details, see [START_REF] Suzuki | Penalized least squares approximation methods and their applications to stochastic processes[END_REF].

Related to regularization methods for point processes, [START_REF] Fan | Variable selection for Cox's proportional hazards model and frailty model[END_REF] extended the nonconcave penalized likelihood approach to the Cox proportional hazards model. [START_REF] Yue | Variable selection for inhomogeneous spatial point process models[END_REF] treated variable selection in spatial point processes. [START_REF] Hansen | Lasso and probabilistic inequalities for multivariate point processes[END_REF] derived probabilistic inequalities for multivariate point processes in the context of LASSO.

Empirical results -Dependencies analysis

This section describes the high-frequency financial data (Section 5.1) and several empirical studies conducted with it. A detailed example of financial analysis allowed by the ratio model is provided in Section 5.2, where the determination of the sign of the next trade in a limit order book is carried out with several covariates. Other examples are provided in subsequent sections, illustrating the influence of the spread and queue sizes in the order book.

Data

We use Reuters TRTH tick by tick data for 36 stocks traded on the Paris stock Exchange on most of the year 2015. The list of the stocks is given in Appendix B. For each stock and each trading day, the orders flow is reconstructed using the method described in Muni Toke (2016), and we keep all trades and quotes recorded between 9:30 am and 5:00 pm1 . When adding all stocks and trading days, the sample represents more than one billion events (more than 50 millions market orders, more than 500 millions limit orders, and more than 450 millions cancellations).

All models are numerically estimated using R by quasi-likelihood maximization. For practical purposes, we provide practical explicit expressions for the log partial likelihood. Using Equation (4), one may write Equation ( 6) with respect to θ as:

H T (θ) = - i∈I T 0 log   i ∈I exp   j∈J (θ i j -θ i j )X j (t)     dN i (t) = - i∈I T 0 log   1 + i ∈I\{i} exp   j∈J (θ i j -θ i j )X j (t)     dN i (t) (31)
Equation ( 17) is similarly written. In the example case I = {0, 1, 2} with three counting processes, the quasi-log likelihood given at Equation ( 31) is written:

H T (θ) = - T 0 log   1 + exp   j∈J θ 1 j X j (t)   + exp   j∈J θ 2 j X j (t)     dN 0 (t) - T 0 log   1 + exp   - j∈J θ 1 j X j (t)   + exp   j∈J (θ 2 j -θ 1 j )X j (t)     dN 1 (t) - T 0 log   1 + exp   - j∈J θ 2 j X j (t)   + exp   j∈J (θ 1 j -θ 2 j )X j (t)     dN 2 (t) (32)
An important feature of the model may be underlined here. Many mathematical models of limit order books, and models in high-frequency finance in general, rely on simple point processes, i.e. processes for which one may not observe two simultaneous events. Confronting such modeling to empirical data thus often requires that the timestamps of all recorded events are different. This condition, even with resolutions down to milliseconds or even microseconds, is not verified on financial markets, where burst of activities are translated into data files by multiple events at the same timestamp. Randomization, i.e. adding a small random quantity to the observed timestamps, is often proposed as a patch to force all timestamps to be different. A nice feature of the setting proposed here is that such patches are not necessary : likelihood (31) does not depend on interval times between consecutive events, but only on the number of events. Therefore, the model can be applied even on data with low resolution timestamps.

Trades signs in a limit order book

It is well known that imbalance is good proxy to the sign of the next trade. Empirical observations can be found in e.g. [START_REF] Lipton | Trade arrival dynamics and quote imbalance in a limit order book[END_REF]. [START_REF] Lehalle | Limit order strategic placement with adverse selection risk and the role of latency[END_REF], among others, is an attempt to incorporate this signal in trading strategies. Let us define the imbalance in the order book observed at time t by:

i(t) = q B 1 (t) -q A 1 (t) q B 1 (t) + q A 1 (t) , ( 33
)
where q A 1 (t) and q B 1 (t) are the number of shares available at time t at the best quote on the ask side and bid side respectively. An imbalance close to +1 indicates a very small available volume on the ask side and consequently a probable upward price move, while an imbalance close to -1 increases the probability of a downward price move. Using our model, we can infer how the imbalance affects the relative intensities of bid and ask market orders. Let us assume that counting processes of ask market orders N M A and bid market orders N M B are point processes with intensities :

λ M A (t, ϑ M A ) = λ 0 (t) exp ϑ M A 0 + ϑ M A 1 i(t) , λ M B (t, ϑ M B ) = λ 0 (t) exp ϑ M B 0 + ϑ M B 1 i(t) , (34)
where λ 0 (t) is a potentially random baseline intensity. Parameters

θ i = θ M A i -θ M B i , i = 0, 1 can
be straightforwardly estimated by maximization of the quasi-likelihood. As mentioned above, a very interesting feature of our intensity model is that the intensities ratios r M A and r M B are then directly interpretable as the instantaneous probability that the next market order will occur on the ask side and on the bid side respectively.

The model is fitted monthly for all stocks, from January 2015 to November 2015, which, excluding gaps in the database, gives 390 fits of the model. On Figure 2, we plot for two samples the empirical probability that for a given imbalance, the next trade occurs on the ask side, and the numerical estimation of the theoretical probability

r M A (i) = [1 + exp(-θ 0 -θ 1 i)] -1 for a level
i of imbalance given by the fit of our ratio model. For representativity we rank the 390 fits by increasing mean L 2 distance between empirical and fitted probabilities, and we select two samples representing the 20% and 80% quantiles of this error distribution. All 390 fits are available upon request.

The simple ratio model with one covariate provides a very good fit of the probability of the next trade. But we can obviously investigate further possible factors influencing the sign of the next trade. It has been shown that times series of signs of trades ( (t) = +1 for an ask trade at time t, -1 for a buy trade) exhibit slowly decreasing autocorrelation functions (see e.g., [START_REF] Lillo | The long memory of the efficient market[END_REF]; [START_REF] Bouchaud | Fluctuations and response in financial markets: the subtle nature of 'random'price changes[END_REF]). We can include the sign of the last trade in the ratio model, and assume that counting processes of ask market orders N M A and bid market orders N M B are point processes with intensities :

λ M A (t, ϑ M A ) = λ 0 (t) exp ϑ M A 0 + ϑ M A 1 i(t) + ϑ M A 2 (t) , λ M B (t, ϑ M B ) = λ 0 (t) exp ϑ M B 0 + ϑ M B 1 i(t) + ϑ M B 2 (t) , (35)
Figure 3 plots the updated results for two samples. For representativity, we again select the two samples representing the 20% and 80% quantile measured in mean L 2 error. All 390 fits are available upon request. It is interesting to observe the strong effect of the sign of the last trade on the imbalance predicting power. While a close to zero imbalance unconditionally indicate a close q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q 0.00 0.25 0.50 0.75 1.00 -1.0 -0.5 0.0 0.5 1.0 Observed imbalance Probability of ask market CAPP.PA 201511 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q 0.00 Figure 2: Empirical probability (in red) and fitted probability (in blue) that the next market order is an ask market order, given the observed imbalance. Selected stocks show the 20% (left) and 80%(right) quantiles measured in mean L 2 error. q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q 0.00 0.25 0.50 0.75 1.00 -1.0 -0.5 0.0 0.5 1.0 Observed imbalance Probability of ask market AXAF.PA 201502 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q 0.00 to 50% probability of an ask trade (see Figure 2), this dramatically changes when the sign of the last trade comes into play. We now observe on Figure 3 two probability curves, one for each sign of the preceding trade, and these curves highlight a kind of hysteresis effect in sign determination with respect to the imbalance. For example, during a series of bid (resp. ask) market orders, the imbalance level at which an ask (resp. bid) market order becomes more probable is not around 0, but higher (resp.lower). On the selected graphs the 50% crossing point for the imbalance level is around ±0.5 (this value may be stock and date dependent).

In a further step, we can investigate the role of the spread on these dynamics. In the case of a large spread observation, then priority can be achieved with limit orders, it is thus expected that the imbalance effect will be less pronounced (as found for example in Stoikov ( 2017)) but that it will interact with . We can thus use the following ratio model :

λ M A (t, ϑ M A ) = λ 0 (t) exp ϑ M A 0 + ϑ M A 1 i(t) + ϑ M A 2 (t) + ϑ M A 3 (t)s(t) , λ M B (t, ϑ M B ) = λ 0 (t) exp ϑ M B 0 + ϑ M B 1 i(t) + ϑ M B 2 (t) + ϑ M A 3 (t)s(t) , (36)
where s(t) = +1 if the observed spread is larger than its mean, and -1 if it is smaller. Obviously, one could use the spread value in ticks for finer models, but we choose categorical variable for graphic illustration purposes. Note that the spread distribution is very stable, so that the mean can for example be computed on the previous sample in the case of repeated fits. Note also that the spread distribution is positively skewed and bounded below by zero, so that s(t) = -1 can be interpreted as the usual spread case, and s(t) = +1 as the large spread case. Figure 4 plots the updated results for two samples. For representativity, we again select the two samples representing the 20% and 80% quantiles measured in mean L 2 error. All 390 fits are available upon request. We now have four curves representing the effect of the imbalance on the next trade sign, depending on the last trade sign and the current spread. Empirical curves are noisier as the samples are split into subsamples to compute conditional probabilities. However, we observe as expected that a large spread flattens the imbalance effect and reinforces the last sign importance. On the provided example fits, if the spread is larger than usual and the last trade was a bid, an ask market order becomes more probable than a bid market order when the imbalance nearly reaches 1, compared to roughly 0.5 when the spread is at its usual values, and to 0 when neither the spread nor the last sign are taken into account.

Since we are exploring the role of several covariates, it is natural to apply the information criteria mentioned in Proposition 4.1. Among other possible sequences a T , we use the QAIC for a T = 2, the QCAIC for a T = log T + 1, and the QBIC for a T = log T , all based on the QMLE θK . As an illustration, Table 2 (left panel) shows the number of times various models are selected among the 390 samples, according to these information criteria. Several comments can be made about this illustration. First of all, it turns out that the simplest model depending only on the imbalance is never selected. Recall for example that the weighted mid-price, commonly used in q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q 0.00 0.25 0.50 0.75 1.00 -1.0 -0.5 0.0 0.5 1.0 Observed imbalance Probability of ask market SCHN.PA 201510 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q 0.00 microstructure as a proxy for a "future" price, depends only on the imbalance. Our observation pleads for the incorporation of more covariates in defining such proxies. It also highlights that, as explained above, the spread acts primarily on the intensity of submission in interaction with the last sign: model with covariates i, and s is (nearly) never selected, in contrast to the model with covariates i, and s. Finally, we observe as expected that QAIC has a tendency to select the model with the greatest number of parameters ; however, using QCAIC or QBIC, the simple model of Equation ( 36) is still selected on more than 40% of the samples over the full model with all terms. These results show that in future works further investigations could be made in determining relevant covariates and possibly analyze a stock-or time-dependency. Among several possibilities, Table 2 (right panel) gives selection results when we add the last price movement (denoted δ) to ratio model.

Our investigation on the influence of the imbalance signal on the intensities of bid and ask market orders can also illustrate the use of the penalized QMLE described in Section 4. In this example, we use the ratio model to try to decide whether traders use the imbalance as a trading signal on a given stock looking at the first level only, or at the first two levels, etc. Let us denote i k (t)

the imbalance observed a time t computed using the cumulative quantities at the best quotes up to the k-th level, k = 1, . . . , 10. i 1 is thus the imbalance previously investigated. For k = 2, . . . , 10, let ∆i k = i k -i k-1 the corrective term between the imbalances computed with k and k -1 limits. We extend the basic model ( 34) to include the standard imbalance as well as all the corrective terms as potential trading signals:

λ T (t, θ T ) = λ 0 (t) exp θ T 0 + θ T 1 i 1 (t) + 10 k=2 θ T k ∆i k (t) , ( 37
)
where

T ∈ {M B, M A}. Let θ k = θ M A k -θ M B k
, k = 1, 10 be our ratio parameters, to be estimated by likelihood maximization. We estimate the model using both standard quasi-likelihood maximization, as well as a penalized estimation using the penarized QMLE θλ of Equations ( 29) and (30). We compute daily fits of the model and plot the mean values of the estimated parameters for each stock. Figure 5 shows the fitted parameters θ k as a function of the level k, as well as the 95% Gaussian empirical confidence interval computed with the empirical standard deviation. For brevity only two stocks are shown, and for simplicty we choose the same ones as in Figure 4 but results for all 36 stocks are similar. It turns out that the parameters associated to the imbalance at level 1 is always very significant, but that the additional information given by the corrective terms ∆i k , k = 2, . . . , 10 is not translated into significant θ k , k = 2, . . . , 10. Penalization greatly helps reducing the confidence intervals of estimates. This results thus seem to be in favor of arguing that traders use imbalance at the first level as a significant trading signal, but do not significantly use information of higher levels.

q q q q q q q q q q q q q q q q q q q q -2 0 2 1 2 3 4 5 6 7 8 9 10 LOB level (1=best quote)

Yearly mean theta Estimation q q Penalized Standard SCHN.PA -Relative theta w.r.t. LOB level q q q q q q q q q q q q q q q q q q q q -4 -2 37). Same stocks as in Figure 4. In these numerical examples, we use q = 1 and λ = 50T -1 2 .

Spread and order flows at the best quotes

Spread as a potential trading signal seems less investigated in the microstructure literature than other factors. One potential reason is that the spread of many highly traded stocks is almost always equal to one tick (so-called large tick stocks). This property has given birth to specific models of such limit order books assuming a constant spread. However, in the studied sample of 36 stocks traded on the Paris stock exchange in 2015, spread cannot be assume equal to one. As such, it must be considered a possible trading signal, influencing the order flows. If the observed spread is large, then a trader wanting to buy a share would rather submit a bid limit order inside the spread than an ask market order. That way the trader will secure priority for the next sell market order, while obtaining a lower price. A market order should only be used by an impatient trader, or a trader believing in an incoming and lasting upward market movement. On the contrary, a spread equal to one tick prevents the use of limit orders to secure priority in future executions. Such mechanisms have been observed in Muni [START_REF] Toke | Modelling intensities of order flows in a limit order book[END_REF] where data analysis shows that the empirical intensity of market orders increases when the spread decreases to one tick.

We can therefore propose a version of our ratio model to investigate the influence of the spread on orders flows occurring at the best quotes. Let us consider a model of best quotes of the limit order book where market orders, limit orders and cancellations are submitted with intensities λ M , λ L and λ C respectively, all sharing an unobserved baseline intensity λ 0 (t) and depending on the observed spread s(t) ∈ N * (i.e expressed in number of ticks) :

λ M (t, ϑ M ) = λ 0 (t) exp ϑ M 0 + ϑ M 1 log s(t) + ϑ M 2 (log s(t)) 2 , (38) λ L (t, ϑ L ) = λ 0 (t) exp ϑ L 0 + ϑ L 1 log s(t) + ϑ L 2 (log s(t)) 2 , (39) λ C (t, ϑ C ) = λ 0 (t) exp ϑ C 0 + ϑ C 1 log s(t) + ϑ C 2 (log s(t)) 2 . ( 40
)
Letting θ L j = ϑ L j -ϑ M j and θ C j = ϑ C j -ϑ M j , j = 0, 1, 2, our intensities ratio model is easily estimated by maximizing the quasi-log likelihood.

We estimate the model for each stock and each trading days, which gives after data cleaning 8052 different samples and associated model fits. As in the previous cases, we compute the intensities ratios to estimate the probabilities of each event given the observed spread. Figure 6 plots the probabilities of market orders, limit orders and cancellations occurring at the best quotes given the observed spread, and compare them to the empirical probabilities computed on the sample. Again for the sake of brevity and representativity we rank the fits by increasing mean L 2 error between model and data, and select four stocks representing the 20%, 40%, 60% and 80% quantiles of the error distribution. It is satisfying to observe that the model provide good fits in a wide range of spread distribution, from a large tick stock (Figure 6, bottom left) where the spread is almost always equal to one tick, to the more interesting case of small tick stocks (e.g., Figure 6, top right), where the probability is correctly estimated up to 9 ticks and more.

Equilibrium behaviour with respect to the queues sizes

We propose a final illustration of the ratio model to investigate the role of the observed queue size in determining the flows of limit orders and cancellations. Some empirical observations of the role of the queue size can be observed in [START_REF] Huang | Simulating and analyzing order book data: The queue-reactive model[END_REF] as well as in Muni [START_REF] Toke | Modelling intensities of order flows in a limit order book[END_REF]. A basic equilibrium argument suggests that when a queue size at a given price is small, then providing liquidity with limit orders is interesting as it secures a relative priority for the trader. On the contrary, when a queue size is large, then cancellations should be more frequent than limit orders. Furthermore, such an argument should be "more" valid inside the book, where only limit and market orders are allowed, than closer to the best quotes, where market orders remove important portions of liquidity and other trading signals, such as the spread and the imbalance previously investigated, play a significant role.

We investigate these insights by building one simple ratio model for limit orders and cancellations occurring inside the book, from level 2 to 10. Level 1 (best quote) is left aside as its dynamics also involves market orders. For each level α ∈ {2, . . . , 10}, let N Lα and N Cα be the counting q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q 0.00 0.25 0.50 0.75 1.00 1 2 3 4 5 6 7 Observed spread Probability q q q q q q q q q q q q q q q q q q Market orders Limit orders Cancel orders TECF.PA 20150324 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q 0.00 0.25 0.50 0.75 1.00 1 2 3 4 5 6 7 8 9 Observed spread Probability q q q q q q q q q q q q q q q q q q Market orders Limit orders Cancel orders STM.PA 20150520 q q q q q q q q q q q q q q q q q q 0.00 0.25 0.50 0.75 1.00 1 2 3 Observed spread Probability q q q q q q q q q q q q q q q q q q Market orders Limit orders Cancel orders LVMH.PA 20150908 q q q q q q q q q q q q q q q q q q q q q q q q 0.00 0.25 0.50 0.75 1.00 1 2 3 4 Observed spread Probability q q q q q q q q q q q q q q q q q q Market orders Limit orders Cancel orders SAF.PA 20150603

Figure 6: Empirical probability (dashed lines) and fitted probability (full lines) that the next order is a market order (red), a limit order (blue) or an cancellation (green), given the observed spread.

x-axis spans more than 99% of the empirical spread distribution, and the shaded area on the right signal the 95% and 99% quantiles of this distribution. Selected samples represent the 20% (top left), 40% (top right), 60% (bottom left) and 80% (bottom right) quantiles of the mean L 2 error distribution among the 8052 tested samples.

processes of limits orders and cancellations occurring at this level, with intensities:

λ Lα (t, θ Lα ) = λ 0 (t) exp θ Lα 0 + θ Lα 1 log q α (t) + θ Lα 2 (log q α (t)) 2 , λ Cα (t, θ Cα ) = λ 0 (t) exp θ Cα 0 + θ Cα 1 log q α (t) + θ Cα 2 (log q α (t)) 2 . ( 41
)
where λ 0 (t) is a potentially random baseline intensity and q α (t) is the volume standing in the book at the level of submission in group α and time t. q α (t) is expressed in integer multiple of the median trade size (see e.g., [START_REF] Huang | Simulating and analyzing order book data: The queue-reactive model[END_REF]; Muni [START_REF] Toke | Modelling intensities of order flows in a limit order book[END_REF] about this normalization).

Let θ α j = θ Lα j -θ Cα j , j = 0, 2, α ∈ {2, . . . , 10}, be the relative parameters of the ratio model, to be estimated by the maximization of quasi-log likelihood.

As in the previous examples, we estimate the model for each stock and each month, and then compute the intensities ratios to estimate the probabilities of each event given the observed volume of the level of submission. Each monthly fit gives 9 fits, one for each level, but for the sake of readability, we plot only three levels: level 2 at the head of the 5 at mid-depth level 8 the of the book. Figure 7 plots the probabilities of limit orders occurring inside the book at these three levels, given the observed volume of the level, and compare them to the empirical probabilities computed on the sample. We show four examples of fits (again selected by computing the quantiles of the mean L 2 error of the fits), but all monthly fits are quite similar and available.

It is interesting that the probabilities of occurrence of a limit order as a function of the observed volume show similar patterns across stocks. The model obviously recovers the expected equilibrium property that decreases the interest (hence the probability) of a limit order when liquidity is already here (i.e. q α is large). Furthermore, the use of a common x-axis makes the the probability curves reflect the general shape of a limit order book. Using a rule of thumb that the equilibrium size of each level should be roughly at the crossing of the .5 probability line, the respective position of the three probability curves reflects the well-known humped shaped of the limit order book [START_REF] Bouchaud | Statistical properties of stock order books: empirical results and models[END_REF]): the mid-book (level 5) is fatter than the head (level 2) and tail (level 8) of the book.

Empirical results : Prediction

Empirical results from Section 5 are in-sample analysis aimed at providing new descriptions of some dependencies observed on financial markets. We now turn to the possible use of the ratio model as a prediction tool. We consider the problem of the sign of the next trade, previously introduced in Section 5.2. The ratio model has helped us model how this sign depends on the state of the order book, through e.g., the imbalance, the spread or the last trade sign. Time series of trade signs are known to be highly auto-correlated, and to be well described by Hawkes processes. In this setting, market orders can be described by a two-dimensional Hawkes process Z = (Z B , Z A ) with q q qq q q q q q q q q q q q qq q q qq qqqq qq qq qq q q qq qq qqq q qq q qqq q qq qqqq qq q qqqqq q q qqqqq qq q q q q q q q q q q q qq q q q q q q qq q qqq qq qqq qqqqq q q qq q qqq qqq q q q qqq q q qq q q qq q q qq q qq qqq q q q q qq q qqqqq qq qq qq qq q q q q qq q q q q qq q q q q qqq q q q q q q q q q q q qqq q q q q q qq q q q qq q q q q q q q q q q q qq q q q q q q q q q q qq q q q qqq q q q q q qq q q q q q q q qqqq q q q q q q 0.00 0.25 0.50 0.75 1.00 0 25 50 75 Observed q Probability that next order is limit vs cancel Levels q q q 2 5 8 AIRP.PA 201511 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q 0.00 0.25 0.50 0.75 1.00 0 10 20 30 40 Observed q Probability that next order is limit vs cancel Levels q q q 2 5 8 SGOB.PA 201504 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q 0.00 0.25 0.50 0.75 1.00 0 10 20 30 40 Observed q Probability that next order is limit vs cancel Levels q q q 2 5 8 SAF.PA 201511 q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q q 0.00 0.25 0.50 0.75 1.00 0 10 20 Observed q Probability that next order is limit vs cancel Levels q q q 2 5 8 BOUY.PA 201509

Figure 7: Empirical probability (dots and dashed lines) and fitted probability (lines) that the next order is a limit order, given the observed level of the queue of submission. x-axis spans more than 99% of the empirical volume distribution (at all levels), and the shaded area on the right signal the 95% and 99% quantiles of this distribution. exponential kernels, its conditional intensity λ Z = (λ Z B , λ Z A ) being written in vector notations as

λ Z (t) = µ Z + t 0 K(t -s) dZ s , (42)
where µ Z = (µ Z B , µ Z A ) is the baseline intensity and the kernel matrix

K(t) = α BB e -β BB t α BA e -β BA t
α AB e -β AB t α AA e -β AA t (43)

describes the self-and cross-excitation parts.

A simple ratio model with only current observations of the state and not taking into account the history of the order flow (except for the last trade sign) can probably not compete with the Hawkes description. However, we can incorporate some history into covariates of the ratio model.

One may for example consider the following covariates:

H A (t) = log µ A + t 0 α A e -β A (t-s) dN A s , (44)
H B (t) = log µ B + t 0 α B e -β B (t-s) dN B s , (45)
where (N B , N A ) counts the number of bid and ask market orders. These covariates add some self-exciting history into the ratio model.

We can thus examine different methods to predict the trade sign, given that one trade is observed a given time. This is of course a theoretical exercise, as we predict the trade sign with all the information available just before its occurrence, not taking into account latency, information delays, reaction times, etc., that would hinder the performances in a more realistic setting. We test seven methods for this exercise:

• Last : the trade sign is set to be the same as the last observed trade sign ;

• Imbalance : the trade sign is set to -1 if the imbalance observed before its submission is negative, +1 otherwise;

• Hawkes Full : at each time we compute the intensity λ Z of the Hawkes process described at Equations ( 42)-( 43), given the observed history, and set the sign to be -

1 if λ Z B > λ Z A , +1
otherwise.

• Hawkes NoCross : same as the previous method, except that we independently fit two Hawkes processes for the bid and ask market orders, i.e. we set α BA = α AB = 0;

• Ratio (i, , s) : we use the probabilities given by the basic ratio model of Equation ( 36) and set the sign to be -1 if the probability of an ask market order given by the ratio model is • Ratio (H B , H A , i, , s) : same as the previous method, but using both (H A , H B ) and the covariates (i, , s) in the ratio model.

We test these methods on the sample described at Section 5.1. "Last" and "Imbalance" methods do no require any calibration. For the other methods, calibration is carried out on the trading day preceding the day at which prediction performance is evaluated. Models "Hawkes Full" and "Hawkes NoCross" are fitted with a maximum-likelihood estimation (see e.g. [START_REF] Ogata | The asymptotic behaviour of maximum likelihood estimators for stationary point processes[END_REF], [START_REF] Ozaki | Maximum likelihood estimation of Hawkes' self-exciting point processes[END_REF] Results are illustrated in Figure 8. For all stocks, the "Last" indicator correctly predicts more than 80% of the trade signs, e.g. less than one trade out of 5 has a sign different from the preceding Figure 9: Fraction of correctly predicted trade sign per method and per stock, averaged on all available trading days.

trade. The "Imbalance" indicator is less performant, signing correctly about 70% -80% of the trades. The model "Ratio (i, , s)" of Section 5.2 builds on these two indicators to improve the signing performance to about 85%. Hawkes models perform as the "Imbalance": the performance of the "Hawkes Full" method lies in the range 73% -78%, less than the "Hawkes NoCross" model that actually does better in this prediction exercise, always around 75% -80%. This result is an illustration of the observation that parcimony is often crucial for prediction. Now, it is interesting to observe that the ratio model is actually able to match and improve the Hawkes performances. Using only the covariates (H B , H A ), the "Ratio (H B , H A )" method actually mimicks the Hawkes process, the two performances curves being very close. The advantage of the ratio model is the possibility to consider both the history covariates (H B , H A ) and the state covariates (i, , s). The model "Ratio (H B , H A , i, , s)" turns out to deliver the best prediction of the trade sign, improving the performance of the "Ratio (i, , s)" model by a bit more than 2.5% in average on all the stock-days.

We can analyse a bit further these performances. We now focus on the prediction of a sign change, i.e. we compute the performance using only the trades that have a sign different from the previous trade (roughly 20% of the sample, given the observation above). Results are averaged for each stock on Figure 9. The performance of the "Imbalance" signal is roughly similar. The "Last"

indicator has obviously a performance equal to 0, as it never predicts a sign change. The ratio model without any history also performs poorly (around 40%) in this specific subsample, since its only history relies on the last trade sign. Both Hawkes model are also less performant, always even worse than the basic "Imbalance" signal. The interesting point is that in this specific subsample, the combination of the Hawkes covariates and the state covariates (i, , s) described in Section 5.2 significantly improves the Hawkes models and the "Ratio (i, , s)" model. The average performance increase on all the stock-days of the sub-sample for the "Ratio (H B , H A , i, , s)" model with respect to the best Hawkes model is more than 13%. In brief, trade signs are quite well represented by Hawkes processes, but the addition of a state-dependency by means of a ratio model allows a better tracking of the sign changes, explaining an overall better performance.

Conclusion

We have presented a model based on ratios of Cox-type intensities sharing a common, possibly random, baseline intensity. Consistency and asymptotic normality of the estimators have been proved. Such a model may be very useful in cases where one tries to investigate the role of given covariates on point processes in a fluctuating environment, but in which (some of) these fluctuations are assumed to equally influence all the processes under scrutiny. This is therefore a plausible framework in finance, where global market activity varies wildly during the trading day. The proposed setting removes this common baseline intensity from the estimation procedure, allowing to focus on the role of covariates. Using this method we have in particular been able to highlight how signals such as market imbalance, bid-ask spread and sizes of limit order book queues do influence trading activity. This framework may hopefully be helpful in many other studies in high-frequency finance. Several directions of research and applications may indeed be followed, among which model selection and the identification of significant trading signals.

Then

∆ T = T -1/2 i∈I T 0 g i (X(t), θ * )d Ñ i t , (65)
where

Ñ i t = N i t - t 0 λ i (s, ϑ * )ds (i ∈ I) (66)
We have

λ i (t, θ) ≤ λ 0 (t) i∈I exp X(t)[ϑ * i ] , |g i (X(t), θ)| ≤ 2|X(t)| (67)
and

| log r i (t, θ)| = | log ρ i (X(t), θ)| ≤ C i (1 + |X(t)||θ|) (68)
for some constant C i depending on i.

By the Burkholder-Davis-Gundy inequality, we obtain

E T -1/2 T 0 h(X(t))d Ñ i t 2k ≤ C k E T -1 T 0 h(X(t)) 2 dN i t k ≤ C k E T -1 T 0 h(X(t)) 2 d Ñ i t k + C k E T -1 T 0 h(X(t)) 2k λ i (t, ϑ * ) k dt ≤ C k E T -1 T 0 h(X(t)) 2 d Ñ i t k + C k E h(X(0)) 2k λ i (0, ϑ * ) k (69)
for any k ∈ N and any measurable function h of at most polynomial growth. By Equation ( 65) and induction, we obtain (i).

Set

M T (θ) = i∈I T -1 T 0 log ρ i (X(t), θ) ρ i (X(t), θ * ) d Ñ i t (70)
and

K T (θ) = T -1 T 0 f (λ 0 (t), X(t), θ)dt, (71)
where

f (w, x, θ) = i∈I log ρ i (x, θ) ρ i (x, θ * ) ρ i (x, θ * )Λ(w, x) -E i∈I log ρ i (X(0), θ) ρ i (X(0), θ * ) ρ i (X(0), θ * )Λ(λ 0 (0), X(0)) . ( 72
) Then Y T (θ) -Y(θ) = M T (θ) + K T (θ). (73)
Similarly to the proof of (i), we obtain sup

k=0,1 sup θ∈C[Θ] sup T >1 T 1/2 ∂ k θ M T (θ) p < ∞ (
T >1 T 1/2 ∂ k θ K T (θ) p < ∞ (75)
for every p ≥ 2. Now Sobolev's embedding inequality in W 1,p (C[Θ]) → C(C[Θ]) for p > p ∨ 2 gives (ii). In a similar fashion, it is possible to prove (iii). The proof of (iv) is also similar to that of (ii), and rather simpler.

Z T (u) ≥ exp -2 -1 r 2-(ρ 1 ∨ρ 2 ) < ∞, (76)
where V T (r) = {u ∈ U T ; |u| ≥ r}.

(ii) Z T admits a locally asymptotically normal representation

Z T (u) = exp ∆ T [u] - 1 2 Γ[u ⊗2 ] + r T (u) (77)
with r T (u) → p 0 as T → ∞ for every u ∈ R p and ∆ T → d N p (0, Γ) as T → ∞.

Proof. We will verify the conditions of Theorem 3 (c) of [START_REF] Yoshida | Polynomial type large deviation inequalities and quasi-likelihood analysis for stochastic differential equations[END_REF] for the naturally extended

Z T (u) ≥ exp -2 -1 r 2-(ρ 1 ∧ρ 2 ) < ∞, (78)
which gives (i).

The term r T (u) is defined by (77) for u ∈ U T . For each u ∈ R p , for sufficiently large T , r T (u) admits the representation

r T (u) = 1 0 (1 -s) Γ[u ⊗2 ] -Γ T (θ † T (su))[u ⊗2 ] ds. (79)
Then Lemma A.1 (iii) and (iv) verify the convergence r T (u) → p 0 as T → ∞.

For u = (u i j ) i∈I 0 ,j∈J and x = (x j ) j∈J ,

i∈I i 1 ∈I 0 ,j 1 ∈J δ i,i 1 -ρ i 1 (x, θ) x j 1 u i 1 j 1 2 ρ i (x, θ) = i 1 ,i 2 ∈I 0 j 1 ,j 2 ∈J i∈I δ i,i 1 -ρ i 1 (x, θ) δ i,i 2 -ρ i 2 (x, θ) ρ i (x, θ) x j 1 x j 2 u i 1 j 1 u i 2 j 2 = i 1 ,i 2 ∈I 0 j 1 ,j 2 ∈J δ i 1 ,i 2 ρ i 1 (x, θ) -ρ i 1 (x, θ)ρ i 2 (x, θ) x j 1 x j 2 u i 1 j 1 u i 2 j 2 = V 0 (x, θ) ⊗ x ⊗2 [u ⊗2 ]. ( 80
)
Since it is assumed that N i (i ∈ I) do not have common jumps, The conditional type Lindeberg condition is easily verified by dividing the range [0, T ] of the integral (65) into T subintervals, and as a result, we see ∆ T → d N p (0, Γ), which concludes the proof of (ii).

T
It is possible to extend Z T to R p so that the extension has a compact support and sup

u∈R p \U T Z T (u) ≤ max u∈∂U T Z T (u). ( 82
)
We will denote this extended random field by the same Z T . Then Z T is a random variable taking values in the Banach space Ĉ = {f ∈ C(R p ); lim |u|→∞ f (u) = 0} equipped with sup-norm. On some probability space, we prepare a random field

Z(u) = exp ∆[u] - 1 2 Γ[u ⊗2 ] (u ∈ R p ) (83)
where ∆ ∼ N p (0, Γ). By Lemma A.2 (ii), we have a finite-dimensional convergence

Z T → d f Z (84)
as T → ∞.

)

  Based on the quasi-likelihood function H T , the criterion C T (S K ) gives the quasi-consistent AIC (QCAIC) when a T = log T + 1, and the quasi-BIC (QBIC) when a T = log T among many other possible choices of a T . A Hannan and Quinn type of quasi-information criterion (QHQ) is the case where a T = c log log T for c > 2. The quasi-AIC (QAIC) is the case where a T = 2 but it cannot exclude overfitting though it excludes misspecified models, as usual and as suggested in the proof of Proposition 4.1.

Figure 3 :

 3 Figure3: Empirical probability (in red) and fitted probability (in blue) that the next market order is an ask market order, given the observed imbalance. Upward (resp. downward) triangles indicate that the last trade was an ask (resp. bid) market order. Selected stocks show the 20% (left) and 80%(right) quantiles measured in mean L 2 error.

Figure 4 :

 4 Figure4: Empirical probability (in red) and fitted probability (in blue) that the next market order is an ask market order, given the observed imbalance. Upward (resp. downward) triangles indicate that the last trade was an ask (resp. bid) market order. Dashed (resp. full) lines represent large (resp. usual) spread values. Selected stocks show the 20% (left) and 80%(right) quantiles measured in mean L 2 error.

  Figure 5: Mean daily estimate (curves) and 95% confidence interval (shaded areas) of θ k for the imbalance model with corrective terms of Equation (37). Same stocks as in Figure4. In these numerical examples, we use q = 1 and λ = 50T -1 2 .

Figure 8 :

 8 Figure 8: Fraction of correctly predicted trade sign per method and per stock, averaged on all available trading days.

Lemma A. 2 .

 2 Suppose that [A1]-[A3] are satisfied. Then (i) For any L > 0

  random field H T over C[Θ]. Condition [A1 ] therein holds according to Lemma A.1 (iii) and (iv). Condition [A4 ] therein is satisfied with β 2 = 0 under Equation (63). Lemma A.1 (i) and (ii) ensures Condition [A6] therein. Condition [B1] therein is obvious and Condition [B2] therein is(56). Therefore, by Theorem 3 of[START_REF] Yoshida | Polynomial type large deviation inequalities and quasi-likelihood analysis for stochastic differential equations[END_REF]

  X(t), θ * )[u] 2 ρ i (X(t), θ * )Λ(λ 0 (t), X(t))dt = T -1 T 0 V 0 (X(t), θ) ⊗ X(t) ⊗2 [u ⊗2 ]Λ(λ 0 (t), X(t))dt.(81)Under [A1] and [A2], the term on the right-hand side converges in probability to Γ[u ⊗2 ] as T → ∞.

For δ > 0

 0 and c > 0, define w T (δ, c) byw T (δ, c) = sup log Z T (u 2 ) -log Z T (u 1 ) ; u 1 , u 2 ∈ B c , |u 2 -u 1 | ≤ δ(85) for large T , where B c = {u ∈ R p ; |u| ≤ c}. Then by Lemma A.1 (iii) and the definition of Z T , we have lim δ↓0 lim supT →∞ P w T (δ, c) > = 0 (86)for every > 0 and c > 0.According to e.g. Theorem 4 of[START_REF] Yoshida | Polynomial type large deviation inequalities and quasi-likelihood analysis for stochastic differential equations[END_REF], we obtain (13) for ûM T since Conditions [C1] and [C3] therein are ensured by (86) and by (84), respectively, and Condition [C2] is trivial now.The properties (86) and (84) give functional convergenceZ T | Bc → d Z T | Bc in C(B c )(87)as T → ∞ for each c > 0. Moreover, Lemma A.2 already provided the PLD inequality for Z T .Thus e.g. Theorem 10 of[START_REF] Yoshida | Polynomial type large deviation inequalities and quasi-likelihood analysis for stochastic differential equations[END_REF] proves (13) for ûB T once the estimate sup However, (88) can be verified e.g. with Lemma 2 of[START_REF] Yoshida | Polynomial type large deviation inequalities and quasi-likelihood analysis for stochastic differential equations[END_REF]. This completes the proof of Theorem 3.1.

Table 1 : Numerical results for the estimation of the 10 parameters of the model defined at Equation (16). Standard deviations a given in parenthesis. See text for details.

 1

					Estimators distribution T=1000
				8				q	Empirical density Gaussian fit
									Theoretical density
				6
			Density	4
				2
				0
				15	-0.10	-0.05	0.00	0.05	0.10	0.15
							Error
	Figure 1: Distribution of the estimator of the estimation error θ -θ * for the model defined in
	Example 1. Asymptotic variance defined at Equation (12) is retrieved experimentally.
	used as a starting point for a final maximization of the likelihood of the full model, in order to en-
	sure that we keep the desired properties of the maximum likelihood estimators. Estimation results
	on simulations of the model (16) are presented in Table 1. "Full" denotes the standard maximum
		α0	α1	β0	β1		ϑ 0 0	ϑ 0 1		ϑ 1 0	ϑ 1 1	ϑ 2 0	ϑ 2 1
	True	1.000	2.000	2.000	10.000	0.500	1.000	0.500	-1.000	-0.500	1.000
	Full	0.942 (0.819) (1.150) (0.878) (2.492) (0.013) (0.013) (0.049) (0.020) (0.004) (0.019) 1.507 2.131 5.647 0.499 1.011 0.517 -1.003 -0.504 1.015
	Combined	0.994 (0.155) (0.154) (0.233) (1.034) (0.005) (0.005) (0.004) (0.005) (0.004) (0.005) 1.993 1.981 9.923 0.500 1.000 0.500 -1.000 -0.500 1.000
	likelihood estimation. "Combined" denotes the mixed method involving a ratio estimation as a first
	step. Optimizations are carried out with a Nelder-Mead algorithm (Python scipy implementation)

Table 2 :

 2 Number of times a model for the intensity of bid and ask market orders is selected among the 390 samples, according to several information criteria. Models are named by the names of the covariates separated with a dot, with the notations defined in the text. "+int" means that all interaction terms are included in the model. E.g., "i. . s" is the model defined at Equations (36). Left panel investigates covariates i, and s only, while right panel adds the last price δ.

	d	Model	QAIC QCAIC QBIC QAIC QCAIC QBIC
	2	i	0	0	0	0	0	0
	3	i.	0	2	2	0	2	2
	4	i. .s	1	1	1	1	1	1
	4	i. . s	79	162	158	48	118	114
	7	i. .s + int	310	225	229	218	175	178
	11 i. .s.δ + int	-	-	-	123	94	95

  and later[START_REF] Bowsher | Modelling security market events in continuous time: Intensity based, multivariate point process models[END_REF],[START_REF] Bacry | Modelling microstructure noise with mutually exciting point processes[END_REF] or Muni[START_REF] Toke | Modelling trades-through in a limited order book using Hawkes processes[END_REF] in a financial setting). The parameters (µ A , α A , β A ) and (µ B , α B , β B ) used to compute the covariates H A and H B are obtained by the same method, i.e. the estimated values of the parameters (µ A , α A , β A ) used to compute H A correspond to the estimated values (µ Z A , α AA , β AA ) of the "Hawkes NoCross" model. Note that the preceding day in the sample means Friday for Mondays, and possibly some other previous day in case of missing trading days in the data. Recall that this sample represents roughly 54 millions trades.

Table 3 :

 3 List of stocks investigated in this paper. Sample consists of the whole year 2015, representing roughly 230 trading days for all stocks except LAGA.PA and PEUP.PA which are missing roughly 70 trading days.

Removing the beginning and the trading day has been done as a usual precautionary step when dealing with high-frequency trades and quotes databases, as one may sometimes be concerned with data quality in very busy periods. However, this precaution may actually not be necessary. For example, when recomputing Figure4below using the whole trading day, no we observe no significant visual difference with the version presented in this paper.

Acknowledgements

This work was in part supported by Japan Science and Technology Agency CREST JPMJCR14D7; Japan Society for the Promotion of Science Grants-in-Aid for Scientific Research No. 17H01702 (Scientific Research), No. 26540011 (Challenging Exploratory Research); and by a Cooperative Research Program of the Institute of Statistical Mathematics.

A Mathematical proofs

A.1 Proof of Theorem 3.1

We have

and λ i (t, ϑ * ) = ρ i (X(t), θ * )Λ(λ 0 (t), X(t)).

Simple calculus yields

and

where θ α = (θ α j ) j∈J . In other words,

For the closed convex hull

Then

and the equality holds if and only if

Condition (53) implies that exp X(0

due to θ 0 = θ * 0 = 0. Therefore,

and hence

The quasi-likelihood ratio random field is define by

We will use also

For this extension, we notice r i (t, θ) and hence H T is naturally extended to C[U T ]. The random field Z T will be used to obtain the so-called polynomial type large deviation inequality for Z T .

Define Y T by

with the naturally extended H T . Define a p-dimensional random variable ∆ T and a p × p random matrix Γ T by

and

Take parameters α, β 1 , ρ 1 and ρ 2 so that

where β = α/(1 -α). We have Lemma A.1. Suppose that [A1] and [A2] are satisfied. Let p be any positive number. Then

A.2 Proof of Proposition 4.1

by Lemma A.1 (ii) and ( 56) applied to the sub-models S K and S K * in place of Θ. Then (i) holds

Next, suppose that θ * ∈ S K and S K = S K * . Obviously, d(S K ) > d(S K * ). Denote by Γ K the matrix consisting of the elements of Γ with indices in K. Then [A3] implies det Γ K > 0. Thus, we can obtain the same results as in Theorem 3.1 for θK . In particular,

for both QMLE and QBE for the model S K since θ * ∈ S K , where ûK = √ T ( θK -θ). This is also valid for the model S K * with θK * . Therefore,

as T → ∞, which completes the proof.

B List of stocks

Table 3 lists all the stocks investigated in the paper.