Skip to main content

Point process library with Hawkes specialization. Rust-accelerated MLE, EM, online, and Bayesian inference.

Project description

intensify

PyPI Python License: MIT CI

A modern Python library for point processes broadly — Poisson, Cox, and Hawkes — with deep Hawkes specialization. Built for quantitative finance and computational neuroscience, tested on real spike-train recordings, and Rust-accelerated on the likelihood and simulation hot paths.

pip install intensify

Binary wheels are published for Linux (x86_64, aarch64), macOS (Intel and Apple Silicon), and Windows (x86_64) on Python 3.10 – 3.12. Source builds require a Rust toolchain — install via pip install 'intensify[fast]'.

Quickstart

import numpy as np
import intensify as its

# Simulate event times from a self-exciting process.
model = its.Hawkes(mu=0.6, kernel=its.ExponentialKernel(alpha=0.55, beta=1.4))
events = model.simulate(T=80.0, seed=1)

# Fit μ, α, and β jointly from the observed events.
result = model.fit(events, T=80.0)

print(f"Branching ratio: {result.branching_ratio_:.3f}")
print(f"Log-likelihood:  {result.log_likelihood:.3f}")
print(f"Fitted params:   {result.flat_params()}")

# Visualize fitted intensity and diagnostics
fig = its.plot_intensity(result)
fig.savefig("quickstart_intensity.png", dpi=160)

Representative output:

Branching ratio: 0.547
Log-likelihood:  -66.671
Fitted params:   {'mu': 0.6271952244498643, 'alpha': 0.5470266035451343, 'beta': 1.0562059205150198}

Fitted Hawkes conditional intensity

Other common workflows:

# Multivariate connectivity: estimate directed excitation strengths.
kernels = [
    [its.ExponentialKernel(0.20, 1.0), its.ExponentialKernel(0.05, 1.0)],
    [its.ExponentialKernel(0.10, 1.0), its.ExponentialKernel(0.25, 1.0)],
]
mh = its.MultivariateHawkes(n_dims=2, mu=[0.5, 0.6], kernel=kernels)
mv_events = mh.simulate(T=100.0, seed=4)
mv_result = mh.fit(mv_events, T=100.0, fit_decay=False)
print(mv_result.connectivity_matrix())

# Goodness of fit: time-rescaling theorem residuals.
from intensify.core.diagnostics.goodness_of_fit import time_rescaling_test

ks_stat, p_value = time_rescaling_test(result)
print(f"KS stat={ks_stat:.3f}, p={p_value:.3f}")

# Cox process: latent, time-varying intensity for spike-train style data.
lgcp = its.LogGaussianCoxProcess(n_bins=80, mu_prior=-0.2, sigma_prior=0.6)
spikes = lgcp.simulate(T=10.0, seed=11)
print(len(spikes), "events from an LGCP prior sample")

Features

  • Process families (full point-process spectrum, not just Hawkes):
    • Poisson: HomogeneousPoisson, InhomogeneousPoisson (callable intensity or piecewise-constant rates).
    • Cox: LogGaussianCoxProcess (LGCP), ShotNoiseCoxProcess.
    • Hawkes: univariate, multivariate, marked, nonlinear (softplus / sigmoid / relu / identity links), multivariate-nonlinear, signed (inhibitory).
  • Kernel family: Exponential, Sum-of-Exponentials, Power-Law, Approximate Power-Law (Bacry–Muzy), Nonparametric (piecewise-constant). Every kernel is supported in every MLE path.
  • Inference: MLE with hand-derived closed-form gradients (no autodiff in the hot path); recursive O(N) likelihood for exponential-family kernels; EM and online (streaming) updates route through the same Rust core; Bayesian MCMC via numpyro (optional [bayesian] extra).
  • Diagnostics: time-rescaling theorem (KS + QQ on inter-compensator increments — the mathematically correct form), AIC/BIC, residual intensity.
  • Simulation: Ogata thinning (general) and cluster/branching (Galton–Watson) — both Rust-backed.
  • Stationarity enforcement: projected gradient for multivariate Hawkes; spectral radius of the kernel-norm matrix stored as branching_ratio_ on every multivariate FitResult.
  • Architecture: Rust core (intensify._libintensify) for kernel, likelihood, gradient, and simulator hot paths. Pure-Python user API. Loud ImportError if the compiled extension is missing.

Why intensify?

intensify and tick solve partly overlapping problems. Pick the right tool:

Capability intensify tick
Inhomogeneous Poisson (arbitrary rate function or piecewise-constant) partial (sim only)
Log-Gaussian Cox Process (LGCP)
Shot-Noise Cox Process
Joint MLE of (μ, α, β) — fits the Hawkes decay for you — (decay must be supplied)
MLE for power-law, approx-power-law, nonparametric kernels
Marked Hawkes fit with any kernel
Nonlinear (softplus / sigmoid / relu) Hawkes, signed kernels
Multivariate stationarity enforcement (projected gradient)
Time-rescaling test on inter-compensator increments
Python 3.10 – 3.12 support, prebuilt wheels 3.8 only, C++ build
Sub-millisecond fits for exp kernels with known decay
Faster than tick at every benchmarked N (decay-given mv_exp)

The benchmark suite builds seeded synthetic Hawkes datasets, fits the same models repeatedly, and reports median wall time over three runs. The apples-to-apples tick comparison locks the exponential decay β, because tick requires the user to provide decay up front; intensify also reports joint-decay runs where it estimates β directly. Full methodology and reproduction commands are in docs/benchmarks.md. Short version, on the decay-given mv_exp_5d problem:

N tick (ms) intensify 0.3.0b1 (ms) speedup
501 1.0 0.5 2.0×
9,271 6.0 2.4 2.5×
91,249 48.0 22.2 2.2×

Joint-decay (β fit per cell) — tick can't do this at all — went from 1100 ms to 14 ms at N=1099 (~80× vs the pre-Rust 0.2.0 baseline). For kernels tick doesn't ship (power-law, nonparametric, signed, marked, nonlinear) intensify is the only option. ISSUES.md #8 is fixed: the nonparametric path now finishes in <1 s at N=500 (previously killed after 7 minutes). End-to-end, the HC-3 real-spike-train stress suite (42 tests across every kernel × every process × diagnostics) dropped from 8m 13s to ~1.3 s — about 380× faster. pyhawkes is no longer usable — its transitive deps depend on APIs removed from SciPy 1.0 in 2017.

Documentation

Full docs: https://hillmatt7.github.io/intensify

Citation

If you use intensify in academic work, please cite it:

@software{intensify,
  author = {Hill, Matthew},
  title  = {intensify: A modern Python point process library with deep Hawkes specialization},
  year   = {2026},
  url    = {https://github.com/hillmatt7/intensify}
}

See CITATION.cff for the machine-readable form.

Contributing & changes

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

intensify-0.3.1.tar.gz (114.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

intensify-0.3.1-cp312-cp312-win_amd64.whl (329.2 kB view details)

Uploaded CPython 3.12Windows x86-64

intensify-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (434.3 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

intensify-0.3.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (412.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

intensify-0.3.1-cp312-cp312-macosx_11_0_arm64.whl (393.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

intensify-0.3.1-cp312-cp312-macosx_10_12_x86_64.whl (418.4 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

intensify-0.3.1-cp311-cp311-win_amd64.whl (329.2 kB view details)

Uploaded CPython 3.11Windows x86-64

intensify-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (432.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

intensify-0.3.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (410.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

intensify-0.3.1-cp311-cp311-macosx_11_0_arm64.whl (396.0 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

intensify-0.3.1-cp311-cp311-macosx_10_12_x86_64.whl (419.1 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

intensify-0.3.1-cp310-cp310-win_amd64.whl (329.2 kB view details)

Uploaded CPython 3.10Windows x86-64

intensify-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (432.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

intensify-0.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (410.8 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

intensify-0.3.1-cp310-cp310-macosx_11_0_arm64.whl (396.0 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

intensify-0.3.1-cp310-cp310-macosx_10_12_x86_64.whl (419.0 kB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

File details

Details for the file intensify-0.3.1.tar.gz.

File metadata

  • Download URL: intensify-0.3.1.tar.gz
  • Upload date:
  • Size: 114.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for intensify-0.3.1.tar.gz
Algorithm Hash digest
SHA256 3cfc467c2bbbc7497ced0c3dcea3092fea8b2121612bce0b7cd50c752458f7ff
MD5 5ceb187b315d115efb27236a26a5db64
BLAKE2b-256 f2bad2ad3194250966157157b7b2b80a62d36bcc58eae376a1dca410ce0ccf30

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.1.tar.gz:

Publisher: publish.yml on hillmatt7/intensify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intensify-0.3.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: intensify-0.3.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 329.2 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for intensify-0.3.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 28aee69d9202be4a99a855e0b404a3b0c84a64c893dee24667331e563f503d52
MD5 cc017ae490b57d4c4a7f84ccbba2a2b5
BLAKE2b-256 0270922d501a84f1c2a1a6097d3af9f32996b81eaba9a2c0a95a716d97bf2e0c

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.1-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on hillmatt7/intensify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intensify-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for intensify-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 fde237451a5923d9d5544adc6b7c73102a0bf55c6fd9e81fd3fd677dbec9a93a
MD5 09135696774b4ca40d02088f3f59b4d3
BLAKE2b-256 c82108a58f0ef192471b8bf95208d54fa26cf1b98c58a7ae2e6e9af7dae77364

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on hillmatt7/intensify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intensify-0.3.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for intensify-0.3.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8b72125a0039a11510882db2be736ac61eecf83bab9f8c5efafa63dbc20bba09
MD5 3783e230c23c6ca84cafdec0faf5a203
BLAKE2b-256 7c3b99508ab42ce0243e56a4f763794fb11d2e7cba8247b1286bc1d1a1cca99d

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on hillmatt7/intensify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intensify-0.3.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for intensify-0.3.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 84e92ba1fb3e4abdb9afcd90ea9a4f6a5038224f5b55c51440905e78de06c080
MD5 5ad71fb18f3c9012a33ab85d79183acd
BLAKE2b-256 a94d3e80e5baae87e915abc58f85084d660f43e4fe4c524cffadfb2d85f76e0a

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish.yml on hillmatt7/intensify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intensify-0.3.1-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for intensify-0.3.1-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d50e782d390aadf4925cc66383dfd8f39d9387af4a0419d3531cebc3841afb6c
MD5 e7e4dd68bd216c73b07bd799fea324be
BLAKE2b-256 fd276fa31ef0b32759b9e0de87587b6d94ee0a9dcee39e340bde73fb7590c768

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.1-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: publish.yml on hillmatt7/intensify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intensify-0.3.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: intensify-0.3.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 329.2 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for intensify-0.3.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d83d14866062b1edfa234669ddaf7cad87160087d660f1d740db8dca8b047894
MD5 f7e32f2be6581014a4210ed03a065b0b
BLAKE2b-256 c9fecb3811ad7bbe518ea553ba1d34fb763eed8100742353b08101d3d719717c

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.1-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on hillmatt7/intensify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intensify-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for intensify-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 04f7d594248cd6000e09ba7d469e0d3d371dc501ca2d6632fb8d104b8708061a
MD5 0fa5c8795b3f373efec1891429881d9f
BLAKE2b-256 d0ee3dde91ce7b3c53576080141d68cd10820ee4761b690a16189b1f120a80ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on hillmatt7/intensify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intensify-0.3.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for intensify-0.3.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e22ba3cf1643d4c6bdf565d3089a686fb9fe7a6c2695074877f754774c344fe6
MD5 02be5d29c2d20635674793c5914489e1
BLAKE2b-256 ea7bef260001f1b4409825adc2e07ffc9e1adaa38cee22ad974e534f435a76f0

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on hillmatt7/intensify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intensify-0.3.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for intensify-0.3.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5c85aff66acdfb23a5aa09cfe9b47d088b207dd58cb6d8f11432e6501260e504
MD5 46f036ff6a544e4e6f2b155c781e344d
BLAKE2b-256 afad0eb4ae2f070e999b3579c40e8eced39a921ee4464a585af67d1593f2981b

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: publish.yml on hillmatt7/intensify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intensify-0.3.1-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for intensify-0.3.1-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 cb7f513a6014ff20fad3a4f4043514f9ccf8ef73ea9311ae1f909132c0a030ea
MD5 5bb1d74b8ee991d28547f1e53f1516ac
BLAKE2b-256 2066ee8890cdf0162bee04df8d80b6e58b9bbda1c184592717ddf0d3989f6b13

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.1-cp311-cp311-macosx_10_12_x86_64.whl:

Publisher: publish.yml on hillmatt7/intensify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intensify-0.3.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: intensify-0.3.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 329.2 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for intensify-0.3.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 ff6d4ecb3191a0343fb3e690184027e26c996fbbf6bdd9cdf52414219c74b9ed
MD5 eaadae4bfb262a55d6de3ac789b94b1b
BLAKE2b-256 aa325a700f31cf380e274fc751e192449697580f9910e8d0b3b5ef3f7ba02c9b

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.1-cp310-cp310-win_amd64.whl:

Publisher: publish.yml on hillmatt7/intensify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intensify-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for intensify-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ba935fdb5fe2ffddf7114c74406b24b903211806c3abf3beadc6f5f09edbb3ba
MD5 24d937fc0e4182f2e42998dd08e4b56c
BLAKE2b-256 b40737338954d330d6a6b2057b90c65684c4513169159fe96a1c689a047110bf

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on hillmatt7/intensify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intensify-0.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for intensify-0.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 41b438271239846219a827489e2879496a7e667e7076bdef359885b1b19cc169
MD5 e2352e07160ae47b9c693c336b403090
BLAKE2b-256 759ec2222950910b0ed8ea042a77ef4814923d9c36cc1777e0c3e14d54c98ecf

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish.yml on hillmatt7/intensify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intensify-0.3.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for intensify-0.3.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 97be2fdac3952040b951050aa5798e1e6af69ad1c6fd56c7164051359c077c38
MD5 684f459de910b303bc406f766adebecd
BLAKE2b-256 bca7ce1109c979bdd810aee2d062b93be7cdbaa669efa1ab6a08668a35812ded

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.1-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: publish.yml on hillmatt7/intensify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file intensify-0.3.1-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for intensify-0.3.1-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 69058eaad57fe060a13e929656df32ffb98ada9d0b7f3d3e44bdb83e75b0eab7
MD5 773241a2c25541de7b3e6ffc8114a2c4
BLAKE2b-256 28837acb24f1cc5ea6c565f0ab48a187a9addce966d9e26c98dd141091b1469a

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.1-cp310-cp310-macosx_10_12_x86_64.whl:

Publisher: publish.yml on hillmatt7/intensify

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page