HEC Lausanne High-frequency data modelling using Hawkes processes Val´ erie Chavez-Demoulin 1 joint work J.A McGill 1 Faculty of Business and Economics, University of Lausanne, Switzerland Boulder, April 2016 Boulder, April 2016 1 / 25
HEC Lausanne
High-frequency data modelling using Hawkes processes
Valerie Chavez-Demoulin1
joint work J.A McGill
1Faculty of Business and Economics,University of Lausanne, Switzerland
Boulder, April 2016
Boulder, April 2016 1 / 25
HEC LausanneHigh frequency financial data
The availability of high frequency data on transactions, quotes andorder flow has revolutionized data processing and has led to statisticalmodeling challenges
At the same time, the frequency of submission of orders has increasedand the time to execution of market orders has dropped from morethan 25 milliseconds in 2000 to less than a millisecond in 2014.
Average number Number of priceof orders in 10s changes (June 26, 2008)
Citigroup 4469 12499General Electric 2356 7862General Motors 1275 9016
Table: Taken from R.Cont, 2011, http://ssrn.com/abstract=1748022
Boulder, April 2016 2 / 25
HEC LausanneTrade database structure
SYMBOL DATE TIME PRICE SIZE G127 CORR CONDNVDA 20060901 9:30:04 28.67 264600 0 0 -NVDA 20060901 9:30:04 28.67 264509 0 2 -NVDA 20060901 9:30:05 28.65 100 0 0 -NVDA 20060901 9:30:05 28.65 200 0 0 -
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
36.5
37.0
37.5
38.0
38.5
Pric
e
09:30:03 10:15:19 11:35:30 13:54:00 15:02:55 15:45:54
Presence of erroneous trades: moving average filteringIrregularly spaced in time: linear interpolation
Boulder, April 2016 3 / 25
HEC LausanneNVDA negative log-returns from 2006 to 2008(15-minutes linearly interpolated)
−0.
10.
00.
10.
20.
3
Time(15min intervals)
Neg
ativ
e lo
g re
turn
s
2006−01−03 2007−01−03 2008−01−02 2008−12−31
NVDA, July to December 2008 negative returns exceedances :
0.02
0.04
0.06
0.08
Time(15min intervals)
Neg
ativ
e lo
g re
turn
s
2008−07−24 2008−09−03 2008−10−13 2008−11−20 2008−12−31
Boulder, April 2016 4 / 25
HEC LausanneExtreme Value Theory:Classical Peaks-Over-Threshold (iid case)
0 20 40 60 80 100
2040
6080
Time
x
The number of exceedances over u has a Poisson distribution withmean λ
Conditional on n exceedances, their sizes Wj = Zj − u are a randomsample of size n from the generalized Pareto distribution (GPD)
Gξ,σ(w) =
{1− (1 + ξw/σ)
−1/ξ+ , ξ 6= 0,
1− exp(−w/σ), ξ = 0.
Boulder, April 2016 5 / 25
HEC LausanneNVDA log-returns from 2006 to 2008 (15-minutesinterpolated) time differences between exceedances overhigh threshold
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●●
●●●●●●●●●●●●●●●●●●●●●●●●●●
●●●●●●●●●
●●●●●●●
●●●●●●●●●●●●●●●●●
●●●●● ●●
● ●●
●●●●●●●
●●●●●
●●●●●●
● ● ●
●●
● ●
●
●
●
0 20 40 60 80 100 120
010
020
030
0
Exponential
Diff
eren
ce in
tim
e
does not seem exponentially distributedhigher than expected frequencies for short distance between extremes
Boulder, April 2016 6 / 25
HEC LausanneHigh-frequency financial data features
Returns not iid
Absolute returns highly correlated
Volatility appears to change randomly with time
Returns are leptokurtic or heavy–tailed
Extremes appear in clusters
Boulder, April 2016 7 / 25
HEC LausanneDeclustering methods exist:An example for daily returns
0.04
0.08
0.12
Original dataR
etur
ns in
%
1975 1980 1985 1990 1995
0.04
0.08
0.12
Declustered data
Ret
urns
in %
1975 1980 1985 1990 1995Boulder, April 2016 8 / 25
HEC LausanneIdea
the classical Peaks-Over-Thresholds (POT) model of EVT assumes anhomogeneous Poisson process
the inter-event times would be independent exponential randomvariables
the Figures above contradict the classical model
Aim: Treats the negative log-returns above a high threshold u as arealization of a marked point process:
Using a first model that combines a self-exciting process for thethreshold exceedance times with Generalized Pareto model for thethreshold excess sizes (mark sizes)
Using a second model that considers a self-exciting POT model
Boulder, April 2016 9 / 25
HEC LausanneOverall loglikelihood (POT method)
Since number and mark size for the threshold exceedances are assumedindependent
l(λ, σ, ξ) = log
P(Nu = n)n∏
j=1
gξ,σ(wj)
.
= n log λ− λ− n log σ − (1 + 1/ξ)n∑
j=1
log(1 + ξwj/σ)+
so inference can be performed separately for the frequency of exceedancesand their sizes.
Boulder, April 2016 10 / 25
HEC LausanneMarked Point Processes (1)
consider an event process (Ti ,Wi ), i ∈ Zobserved over the period (0; t0] gives data (t1,w1), . . . , (tn,wn)
let Ht , entire history of process up to time t
the joint density of the data seen over (0, t0] can be written
n∏i=1
fTi ,Wi |Hti−1(ti ,wi |Hti−1)P(Tn+1 > t0|Htn)
Boulder, April 2016 11 / 25
HEC LausanneMarked Point Processes (2)
Assuming independence of times Ti and marks Wi the conditional densityfunction is
fTi ,Wi |Hti−1(ti ,wi |Hti−1) = fTi |Hti−1
(ti |Hti−1) · fWi |Hti−1(wi |Hti−1)
leading to the log-likelihood
` =
{n∑
i=1
log fTi |Hi−1(ti ) + logP(Tn+1 > t0|Htn)
}A
+
{n∑
i=1
log fWi |Hti−1(wi |Hti−1)
}B
Boulder, April 2016 12 / 25
HEC LausanneHawkes process
Combining separately a Hawkes process for the counting process of thetimes (part A) and a GPD model for the contributions from the marks(part B), the likelihood becomes
` = log
{n∏
i=1
λ(ti |Hti ) exp
(−∫ t0
0λ(u|Hu)du
)}
−n log σ − (1 + 1/ξ)n∑
i=1
log(1 + ξwi/σ)
with λ(t|Ht) being the conditional intensity
Boulder, April 2016 13 / 25
HEC LausanneSelf-exciting process
We chose the following general form with a constant loading µ0
λ(t|Ht) = µ0 +∑j :tj<t
ω(t − tj ;w j),
where µ0 > 0 and the self-exciting function ω(s) has to be positive whens ≥ 0 and 0 elsewhere. For example, the conditional intensity modelproposed by Ogata (1988) is
λ(t|Ht) = µ0 + ψ∑j :tj<t
eδwj
(t − tj + γ)1+ρETAS
where µ0, ψ, δ, γ, ρ > 0.
Boulder, April 2016 14 / 25
HEC LausanneApplications to high-frequency data:15-minutes linearly interpolated NVDA 2008 negativelog-returns
−0.
100.
05
Time(15min intervals)
Neg
ativ
e lo
g re
turn
s
2008−01−02 2008−04−03 2008−07−02 2008−10−01 2008−12−31
0.00
0.06
0.12
Est
imat
ed in
tens
ity
2008−01−02 2008−04−03 2008−07−02 2008−10−01 2008−12−31
Boulder, April 2016 15 / 25
HEC LausanneEstimated cumulative events numberΛHt (t) =
∫ t0 λ(u|Hu)du and two-sided 95% and 99% confidence limits
based on the Kolmogorov-Smirnov statistic
0 50 100 150 200 250 300 350
050
100
150
200
250
300
350
Transformed time
Cum
ulat
ive
num
ber
of e
xtre
me
loss
es
Boulder, April 2016 16 / 25
HEC LausanneAlternative models (1)
Hawkes process with exponential decay
λ(t|Ht) = µ0 + ψ∑j :tj<t
exp{δwj − γ(t − tj)}.
First order Markov chain for the marks
Wi |Wi−1 = wi ∼ GPD(ξ, σi = exp(a + bwi−1))
whose parameters a, b and ξ can be estimated by maximising
n∏i=2
fWi |Wi−1(wi | wi−1)fw1(w1)
Diagnostic for the marginal distribution based on the residuals
Rj = ξ−1 log (1 + ξwj/σj), j = 1, . . . , n
approximately independent unit exponential variables
Boulder, April 2016 17 / 25
HEC LausanneAlternative models (2):A self-exciting POT modelA model with predictable marks
λ?(t,w) =τ + α1ν(t)
σ + α2ν(t)
(1 + ξ
w − u
σ + α2ν(t)
)−1/ξ−1Where ν(t) =
∑j :tj<t ω(t − tj) uses a self-exciting function ω. This uses
the two-dimensional re-parametrisation of the POT:
Homogeneous Poisson process for the exceedances of the level u with
intensity τ = − lnH(u;µ, β, ξ) = {1 + ξ(u − µ)/β}−1/ξ+ , whereH(y ;µ, β, ξ) is the GEV distribution and σ = β + ξ(u − µ)
Inhomogeneous Poisson process for their sizes with intensity
λ(t,w) = λ(w) =1
σ
(1 + ξ
w − u
σ
)−1/ξ−1Boulder, April 2016 18 / 25
HEC LausanneEstimated intensity of exceeding the threshold fromself-exciting POT model for NVDA with Ogata function
0 1000 2000 3000 4000 5000 6000 7000
24
68
10
Time (15 min intervals)Mar
ks a
mpl
itude
in p
erce
nt
0 1000 2000 3000 4000 5000 6000 7000
0.1
0.3
Time (15 min intervals)
Inte
nsity
0 1000 2000 3000 4000 5000 6000 7000
0.8
1.0
1.2
1.4
Time (15 min intervals)
mea
n of
the
GP
D
Boulder, April 2016 19 / 25
HEC LausanneConditional risk measures
The conditional approach models the intraday clustering of extremesand is used to calculate instantaneous conditional p =95% or 99%VaR over the next period
z t+1p = F−1Zt+1|Ht
(p),
FZt+1|Ht(z) = P(Zt+1 > z |Ht) which is
P(Zt+1 − u > z |Zt+1 > u,Ht)× P(Zt+1 > u|Ht).
P(Zt+1 > u|Ht) represents the conditional probability of an event in(t, t + 1) that is:
1− P{N(t, t + 1) = 0|Ht} = 1− exp
(−∫ t+1
tλ(u|Hu)du
)P(ZT+1 − u > z |Zt+1 > u,Ht) is estimated using the GPD modelwith parameters σ and ξ.
Boulder, April 2016 20 / 25
HEC LausanneConditional VaR and Expected Shortfall
The VaR z t+1p is then the solution of the equation
P(ZT+1 > z t+1p |Ht) = 1− p,
Using the self-exciting POT model the condition VaR is
z t+1p = u +
σ + α2ν(t+)
ξ
{(1− p
τ + α1ν(t+)
)−ξ− 1
}
From the estimated conditional VaR it is straightforward to get anestimation of the conditional Expected Shortfall (ES)
ESt+1p =
zt+1p
1− ξ+σ − ξu1− ξ
.
with parameters replaced by their maximum likelihood estimates
Boulder, April 2016 21 / 25
HEC Lausanne15-minutes 95%VaR (red) and 95%ES (blue)estimates for NVDA negative log-returns using self-excitingPOT models and 95%VaR using classical POT (green)
−0.
10−
0.05
0.00
0.05
Times (15 min intervals)
Neg
ativ
e lo
g re
turn
s
2008−07−24 2008−09−03 2008−10−13 2008−11−20 2008−12−31
Boulder, April 2016 22 / 25
HEC Lausanne15-minutes 95%VaR and 95%ES estimates forNVDA negative log-returns using a competitor model(Chavez-Demoulin et al. (2014))
−0.
10−
0.05
0.00
0.05
Time
Neg
ativ
e lo
g re
turn
s
2008−07−24 2008−09−03 2008−10−13 2008−11−20 2008−12−31
Boulder, April 2016 23 / 25
HEC LausanneBacktesting results
0.95 QuantileExpected 25
POT 59 (0)ETAS ρ = 0 21 (0.24)ETAS ρ 6= 0 22 (0.31)
ETAS? ρ = 0 24 (0.47)ETAS? ρ 6= 0 23 (0.39)
exp? 25 (0.55)NPOT 26 (0.39)
0.99 QuantileExpected 5
POT 14 (0)ETAS ρ = 0 6 (0.39)
exp 6 (0.39)ETAS? ρ = 0 6 (0.39)
exp? 7 (0.24)NPOT 9 (0.11)
0.999 QuantileExpected 5
POT 14 (0)H1 ρ = 0 6 (0.39)H2 ρ 6= 0 6 (0.39)
H3 6 (0.39)H1? 6 (0.39)H2? 6 (0.39)H3? 7 (0.24)
NPOT 9 (0.11)
Boulder, April 2016 24 / 25
HEC LausanneReferences
A.G. Hawkes, 1971, Point spectra of some mutually exciting pointprocesses, Biometrika.
Y. Ogata, 1988, Statistical models for earthquake Occurrences andresiduals analysis for point processes, JASA.
E. Errais, K. Giesecke and L.R. Goldberg, 2010, Affine point processesand portfolio credit risk, SIAM J. Financial Math.
Y. AIt-Sahalia, J. Cacho-Diaz, and R. J. A. Laeven, 2010, Modelingfinancial contagion using mutually exciting jump processes, TheReview of Financial Studies.
V. Chavez-Demoulin, A.C. Davison, A.J. McNeil, 2005, A pointprocess approach to Value-at-Risk estimation, Quantitative Finance.
V. Chavez-Demoulin, P. Embrechts, S.Sardy, 2014 Extreme-quantiletracking for financial time series Journal of Econometrics.
Boulder, April 2016 25 / 25