tick
Table of Contents
tick is an open-source Python 3 library, with a C++ core, for statistical learning on time-dependent data. It began in 2016 at the Datascience initiative of École Polytechnique, led by Emmanuel Bacry, Stéphane Gaïffas, Martin Bompaire and Søren Vinther Poulsen. Its core is an optimisation toolbox. Its best-known part is the simulation and inference of Hawkes processes. Return to External knowledge / Knowledge.
1. Summary
ORE Studio does not use tick, link against it or copy its source. The
tick arrival design takes ideas
from tick's Hawkes simulation and builds them again in the style of
ores.analytics.quant. Every source file of that implementation says so in a
comment. The ORE Studio licence applies to the files, because they contain no
tick code. This page records what the ideas are, what we do differently, and
where to read more.
2. Detail
2.1. Where it lives
- Upstream — github.com/X-DataInitiative/tick.
- Documentation — x-datainitiative.github.io/tick.
- Licence — BSD 3-clause, "Copyright (c) 2015-2018, the tick developers".
- Version read — 0.8.0.2, commit
a40d19f868. The read coveredlib/cpp/hawkes/simulation. - In this repo — not vendored, not a dependency.
2.2. The ideas we take
- A point process is simulated by thinning. tick follows Ogata (1981): bound the future intensity, draw a candidate gap from the exponential law at the bound, and keep or discard the candidate by comparing the true intensity to the bound. See Hawkes Process.
- The exponential kernel keeps one running number. tick caches the sum of the kernel over past events, and decays it by \(e^{-\beta\,\Delta}\) between events. Each event then costs constant time.
- The kernel is stated by a branching ratio and a decay. tick's
HawkesKernelExp(intensity, decay)is \(\phi(x) = \text{intensity}\cdot\text{decay}\cdot e^{-\text{decay}\,x}\). So itsintensityis the branching ratio \(n = \alpha/\beta\), and the usual \(\alpha\) isintensity * decay. Our parametrisation also states the kernel by \(n\) and \(\beta\). - A simulation is checked against its compensator. tick can evaluate the compensator at each event, which supports the time-rescaling test in Point Process and Conditional Intensity.
2.3. Where ORE Studio differs
| Matter | tick | ORE Studio |
|---|---|---|
| Dimensions | Any number of streams, with a matrix of kernels | One stream. A feed has one tick stream, and no consumer needs cross-excitation. |
| Kernels | Exponential, sum of exponentials, power law, a user time function | Exponential. A stream of ticks clusters with one exponential kernel, and the sum of exponentials is the first extension. |
| Method | Thinning for every kernel | Direct inversion (Dassios and Zhao 2013) for the exponential kernel. It needs no rejected candidates. Thinning is the method to add for another kernel. |
| Stability | Not checked. A branching ratio of one or more runs until the caller stops it. | Checked in the shared parameter validation: the branching ratio must be below one. A cap on events in a request is a second guard. |
| Parameters | Baseline, intensity (branching ratio) and decay | Long-run rate, branching ratio and decay, which keeps the ticks-per-hour setting of a feed meaningful. |
| Time | A unitless double | Seconds, because the clock sleeps in wall time. |
| Random numbers | Its own Rand wrapper on std::mt19937_64, an int seed |
std::mt19937 from a 32-bit seed, as every process in the library does. A seed does not give tick's numbers. |
| Arrays and storage | Its own array library, reference-counted arrays and cereal serialisation | None. The process keeps one number. |
| Inference | Fits kernels to data by several estimators | None. Our processes generate data. |
| Language | Python 3 front end over C++ | C++ only, in a library that has no logging, database or messaging dependency. |
2.4. Why the source says "inspired by"
The ORE Studio files contain no tick code. They share an algorithm and a parametrisation name with tick, and copyright protects the expression of source, not an algorithm. Even so, the courteous and honest course is to say where the ideas came from. Each file of the implementation carries a short comment that names tick, its licence and this page. The commit that adds the files says the same. If a later change copies any tick source, the BSD 3-clause terms apply to the copied part, and the file must then carry tick's notice.
2.5. How to cite
The tick README asks that scientific work cite the library. The paper is Bacry, Bompaire, Gaïffas and Poulsen (2017), arXiv:1707.03003. A shorter journal version, with Philip Deegan as a fifth author, is in the Journal of Machine Learning Research 18(214), 2018. The Hawkes note lists both under further reading.
3. See also
- External knowledge — the index this page hangs off.
- Hawkes Process — the mathematics, with the references tick builds on.
- Tick arrival — where the implementation sits in the system.
- QuantLib — another upstream library, one that we do depend on.
- arXiv:1707.03003 — the tick paper.