hawkes-engine
Multivariate Hawkes processes with exponential kernels, for Python. A compiled likelihood and gradient, a maximum-likelihood fit that returns standard errors, two independent exact simulators, and time-rescaling diagnostics.
Every library of this kind hands you a standard error. Almost none of them tell you what that number is worth. This one does, because a pre-registered simulation study was run first and its answer is uncomfortable: the standard errors this fit reports are too small. Over 128 simulation cells and 2000 replications each, the mean reported standard error is 0.779 of the true sampling spread. The number is on the front page rather than in an appendix, and the same measurement ships as a lookup you can call on your own data.
Install
python -m pip install hawkes-engine
Version 0.2.0. Wheels for CPython 3.10 to 3.12 on Linux x86-64, macOS (x86-64 and arm64) and Windows AMD64. Building from source needs a C++20 compiler and CMake 3.24; docs/install.md has the commands for each platform.
0.2.0 adds se_method="auto": the fit consults a pre-registered calibration study
and, where the study measured that the inverse-Hessian interval is too narrow in that
regime, reports a bootstrap interval instead, saying which it used and why. Where the
study has no measurement it keeps the Hessian interval and labels it uncalibrated;
where it says the estimator is undefined it reports no interval. The default is still
"hessian", which is what the calibration study measured.
A fit in a few lines
import numpy as np
import hawkes_engine as he
mu = np.array([0.6, 0.9])
alpha = np.array([[0.10, 0.35], [0.20, 0.05]]) # row = target, column = source
beta = np.array([[1.30, 1.70], [1.30, 1.70]])
times, types = he.simulate(mu, alpha, beta, T=20000.0, seed=1)
fit = he.fit(times, types, M=2, T=20000.0, seed=1)
print(fit.alpha.round(3)) # excitation weights
print(fit.se["alpha"].round(3)) # reported standard errors
print(fit.rho) # spectral radius of the branching matrix
print(fit.se_source) # "hessian", "bootstrap" or "none"
Rows are targets and columns are sources: alpha[i, j] is the excitation a type-j
event applies to type i. The fit returns parameters, standard errors, the branching
matrix, its spectral radius, and a conditioning verdict.
The finding
Each point is one cell of the study: the mean reported standard error divided by the empirical standard deviation of the estimate across 2000 replications. A value of 1 means the interval is honest. 56 of 60 cells sit below the line. The baselines and excitation weights are close to it; the decay rates are not, and they collapse at small samples. The y-axis is logarithmic and the lowest points are three orders of magnitude off.
Coverage says the same thing in the units a user actually feels. At 10 000 events and above, a nominal 95 percent interval covers between 0.939 and 0.953, which is usable. At 200 events against a branching ratio of 0.95, it covers 0.40.
| Measured, two types, 2000 or more events | Value |
|---|---|
| Pooled ratio of reported SE to empirical SD | 0.779 ± 0.011 |
| Same, baseline block | 0.936 |
| Same, excitation block | 0.869 |
| Same, decay block | 0.61 |
| Median-based companion, insensitive to the tail | 0.983 ± 0.003 |
The shortfall is concentrated in the tail rather than spread evenly: a median-based companion that ignores it comes out at 0.983, while the mean-based ratio does not. The practical reading is that a reported standard error from this release is a lower bound on the uncertainty, not the uncertainty.
Ask it about your own fit
The study is not only prose. trust_lookup answers from the nearest of the 128
measured cells and returns what that cell measured:
import numpy as np
import hawkes_engine as he
mu = np.array([0.6, 0.9])
alpha = np.array([[0.10, 0.35], [0.20, 0.05]])
beta = np.array([[1.30, 1.70], [1.30, 1.70]])
times, types = he.simulate(mu, alpha, beta, T=20000.0, seed=1)
fit = he.fit(times, types, M=2, T=20000.0, seed=1)
answer = he.trust_lookup(N=len(times), rho_hat=fit.rho, beta=fit.beta.min(), T=20000.0)
print(answer.status) # "measured", "unknown", or "estimator undefined in this regime"
print(answer.coverage["beta"]) # measured coverage of nominal-95 intervals, and its MC SE
print(answer.q["beta"]) # reported SE over empirical SD, and its bootstrap SE
Outside the measured box it says unknown rather than interpolating a number that was
never measured. Where the estimator does not exist it says so.
Let the measurement choose the interval
0.2.0 turns that lookup into a fitting option. The default is still "hessian", which
costs nothing extra and is the method the study measured. se_method="auto" consults
the map instead, and where the map says the inverse-Hessian interval is too narrow in
that regime, it reports a parametric bootstrap interval, refitting the model 200
times.
import numpy as np
import hawkes_engine as he
mu = np.array([0.6, 0.9])
alpha = np.array([[0.10, 0.35], [0.20, 0.05]])
beta = np.array([[1.30, 1.70], [1.30, 1.70]])
times, types = he.simulate(mu, alpha, beta, T=20000.0, seed=1)
fit = he.fit(times, types, M=2, T=20000.0, seed=1, se_method="auto")
print(fit.se_source) # "hessian", "bootstrap" or "none"
print(fit.se_note) # one sentence saying why
A bootstrap is slow enough that silence would be the wrong behaviour, so auto
projects the cost before starting and will not exceed auto_max_seconds (default
120). If it would, it keeps the Hessian interval, says so in se_note, and warns.
Where the map has no measurement for the regime it does the same and labels the
interval uncalibrated. Where the map says the estimator is undefined, it reports no
interval at all. The design of that study is frozen in
docs/preregistration_auto.md, with its own
pre-registered hypotheses, before the harness that ran it existed.
What is not established
- Two of the six pre-registered hypotheses, H6.3 and H6.4, were not confirmed. H6.6 was confirmed but is mostly mechanical: 96.4 percent of
unreliablefits carry no standard error to begin with, and a fit with no interval counts as a miss. FitResult.reliableis a conditioning report, not a statement about bias or coverage. It labelled fitsreliablewhose decay estimate was more than ten times the truth.- The estimator is undefined where the observation window holds a fraction of one decay time. That happened in 67 of the 128 cells. Nothing on the way into
fitstops you fitting such data. - Only two types were calibrated (plus a four-type satellite of 8 cells), with exponential kernels and pair decay.
shared_decay=Trueis a different model and sits outside the map. - Nothing above one million events was timed, and every timing is from one machine. No comparison with any other library has been made, and none is implied.
Each item, with its evidence, is on the Limits page. The hypotheses and their labels are on the Trust page.
Why the numbers can be trusted
The study was designed and frozen before any of it ran. Two of its six hypotheses came back negative and they are reported as such.
- The design is at the annotated tag
H6-preregistration, an ancestor of this release.git diff H6-preregistration -- docs/preregistration.mdshows zero removed lines: six later amendments are appended, not edited in. - The grid is frozen in
studies/theta0.jsonwith a canonical digest, andstudies/verify_grid.pyrefuses to run against a changed grid. - The study's per-cell hashes are in
studies/results/manifest.json. - Two independent simulators (one thinning, one cluster-based) are checked against each other, and the reference implementation used for that check is frozen.
- Every figure quoted on any published page is pinned to the committed output it comes from by
tests/test_docs_claims.py, so a number that drifts from its source fails CI.
Where the evidence is
| Question | File |
|---|---|
| What the standard errors were measured to do | studies/results/analysis/hypotheses.json |
| The paper draft | paper/draft.md |
| How the study was designed, before it ran | docs/preregistration.md at the tag H6-preregistration |
| What each gate established, and what is open | docs/STATE.md |
| How long a fit takes, and how much memory | benchmarks/results/capability_2026-10-21.md |
| The mathematics the code implements | docs/spec/mathematics.md |
| Why the reference implementation is frozen | docs/verification-rule.md |
Documentation: https://freddysccheung-067.github.io/hawkes-engine/. The examples/
directory has six scripts that run in CI, including
one that reproduces the standard-error finding on a
small scale. See also CONTRIBUTING.md, SECURITY.md
and CHANGELOG.md.
Status
0.2.0, unreleased; 0.1.0 is the current release on PyPI, archived at DOI 10.5281/zenodo.23613789. Pre-alpha: the API may change between 0.x minor versions, as described in ADR-009.
License
MIT: see LICENSE.
Metadata
Release files for hawkes-engine 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| hawkes_engine-0.2.0.tar.gz | 1.1 MB | With provenance | Details |
Built distributions (wheels)
Total release size: 4.3 MB
Release files / hawkes_engine-0.2.0.tar.gz
| Download URL | hawkes_engine-0.2.0.tar.gz |
|---|---|
| Size | 1.1 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ae0c32a3ffcad2978f51670cabe1dd7dec5c4d60f1cfee42e126061f8fd8e7c
|
|
BLAKE2b-256 checksum How to use checksums |
0280163266228296ebf5a5d1d556fcfd0ef88c773fc16d859abae1212c9abadf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / hawkes_engine-0.2.0-cp312-cp312-win_amd64.whl
| Download URL | hawkes_engine-0.2.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 413.1 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
a57ba533fc3e83d4d5205e87acfcc699ae98b9741e6dae513ff944023355b1c1
|
|
BLAKE2b-256 checksum How to use checksums |
8f5e6cc3d8edbf1fa180edab27f2cb5d99e5306359d6d3d9ae79a3a31e7fafaa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / hawkes_engine-0.2.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hawkes_engine-0.2.0-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 245.7 kB |
| Tags | CPython 3.12 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
b52c3cb35e6c153f71006eaafa2089ecdb3147da1505c60f8c9ad71ad7182ff6
|
|
BLAKE2b-256 checksum How to use checksums |
c781661c1a366dfc15751416de4cd62aed922f457a35c83319fddd1a6a275de1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / hawkes_engine-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | hawkes_engine-0.2.0-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 206.4 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2a6f1d674cd7d04cf7a0368dce6438fff984d9364d21293d8a68ced5bda8fab5
|
|
BLAKE2b-256 checksum How to use checksums |
08b9da937e3e4032be9ea8d5ca63989c268538da4d0505cedb4c81c98620367f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / hawkes_engine-0.2.0-cp312-cp312-macosx_10_15_x86_64.whl
| Download URL | hawkes_engine-0.2.0-cp312-cp312-macosx_10_15_x86_64.whl |
|---|---|
| Size | 214.3 kB |
| Tags | CPython 3.12 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
b3305011e8ec35288315f6129cdb0cc4b7e5fdaee02afb3c1a065d3fe485f977
|
|
BLAKE2b-256 checksum How to use checksums |
d2b5b74d15039c63bdecf372e792979aca9aafebe11a1cca4e0308fd8e6b1d5a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / hawkes_engine-0.2.0-cp311-cp311-win_amd64.whl
| Download URL | hawkes_engine-0.2.0-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 410.9 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
3872b6ede77a97adcabd0a9e9ba1310e8b4e8f589532655f3bd76d77abeba201
|
|
BLAKE2b-256 checksum How to use checksums |
26ffd020e4f7f43a557d5b1008fe7ef3c07c4f425be2102cd1993f9f82c4a0e9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / hawkes_engine-0.2.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hawkes_engine-0.2.0-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 245.0 kB |
| Tags | CPython 3.11 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
83e88ee11dbad4a2f61e982558e2883679b6e9a0dfd48a43a764c7603b231fd1
|
|
BLAKE2b-256 checksum How to use checksums |
721ebad9e14fc208cb9d442b28d1857c9d571c6e3d5a530a86538c2472748b09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / hawkes_engine-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | hawkes_engine-0.2.0-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 204.7 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
b34039e2217c6cb4870b1aa292a5b37aa0147506894c54a6d5071bcf8c64c21e
|
|
BLAKE2b-256 checksum How to use checksums |
22a511e7fad3814a5647debdfb4728dd61c46f4359f23b39fbe66f110721c589
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / hawkes_engine-0.2.0-cp311-cp311-macosx_10_15_x86_64.whl
| Download URL | hawkes_engine-0.2.0-cp311-cp311-macosx_10_15_x86_64.whl |
|---|---|
| Size | 212.0 kB |
| Tags | CPython 3.11 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
f759502935d6358bd9e53d53d3bafb8fe12506796acdb48325119f9d049a2bbf
|
|
BLAKE2b-256 checksum How to use checksums |
210d27397df4e0ae3e104cd72fff7518b5456bacfa3abc90a1af46a75bfbb23c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / hawkes_engine-0.2.0-cp310-cp310-win_amd64.whl
| Download URL | hawkes_engine-0.2.0-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 410.0 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
356d50f050f96480b1e5ee6b88d17e53430eb78a19bb9eb884029615d98a1887
|
|
BLAKE2b-256 checksum How to use checksums |
a2ea43a3cba6e1ebfe2de279e576d8d5e9c8c9b596f36523823d6cacf05e42e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / hawkes_engine-0.2.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | hawkes_engine-0.2.0-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 244.1 kB |
| Tags | CPython 3.10 Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
d40b5ee0574ab4b79cf5503c72e297bcd223f833de9eaf9e0c61d8982ddb11d4
|
|
BLAKE2b-256 checksum How to use checksums |
edf4026decf12d42552000a870675d3b18c3e2d83f3f901a67f4123a66071575
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / hawkes_engine-0.2.0-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | hawkes_engine-0.2.0-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 202.8 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
54f4b61131648d1d9c38620a05b28245fd1e125344526b11c186833e754f47fd
|
|
BLAKE2b-256 checksum How to use checksums |
221224f0a2bae83bfc07965a8f86ec1537a03c3470215f8afc5c40ff2d57469d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logRelease files / hawkes_engine-0.2.0-cp310-cp310-macosx_10_15_x86_64.whl
| Download URL | hawkes_engine-0.2.0-cp310-cp310-macosx_10_15_x86_64.whl |
|---|---|
| Size | 210.8 kB |
| Tags | CPython 3.10 macOS 10.15+ x86-64 |
|
SHA-256 checksum How to use checksums |
04c8aa3c799ce6c8af9f54a0ce28009af22224b364ff608cce0678c0d1c9d085
|
|
BLAKE2b-256 checksum How to use checksums |
581a15a8a3a9cba6e72ff5a2b95c928014e27e642b72146c262f0052f4d5df3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logSecurity for hawkes-engine 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 13 files in this release have been uploaded with provenance metadata.
Attestation for hawkes_engine-0.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.