Skip to main content

A modern Python point process library: Hawkes specialization, dual-domain interfaces for quantitative finance and computational neuroscience. Rust-accelerated core.

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.0.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.0-cp312-cp312-win_amd64.whl (329.2 kB view details)

Uploaded CPython 3.12Windows x86-64

intensify-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (434.2 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

intensify-0.3.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (412.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ ARM64

intensify-0.3.0-cp312-cp312-macosx_11_0_arm64.whl (393.7 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

intensify-0.3.0-cp312-cp312-macosx_10_12_x86_64.whl (418.3 kB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

intensify-0.3.0-cp311-cp311-win_amd64.whl (329.1 kB view details)

Uploaded CPython 3.11Windows x86-64

intensify-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (432.0 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

intensify-0.3.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (410.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ ARM64

intensify-0.3.0-cp311-cp311-macosx_11_0_arm64.whl (396.1 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

intensify-0.3.0-cp311-cp311-macosx_10_12_x86_64.whl (419.0 kB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

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

Uploaded CPython 3.10Windows x86-64

intensify-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (431.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

intensify-0.3.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (410.9 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.10macOS 11.0+ ARM64

intensify-0.3.0-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.0.tar.gz.

File metadata

  • Download URL: intensify-0.3.0.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.0.tar.gz
Algorithm Hash digest
SHA256 4f8e32b820bd35bbac8a017b0970ab392ac2bcc10a87649ff8e5dddcc70df5df
MD5 5f20afd2cf09cf91c1eb64f4eda2f7c5
BLAKE2b-256 65ca6e6a3eca1d8a10ca3bd946dee61f5baed73e3e0b2b971aad0c22989c3bcb

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.0.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.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: intensify-0.3.0-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.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 6d15fcc431ec50b1831b4d3c43913c1e027770c4900bbefdb5c0076c8acfa7a4
MD5 0290c9ca39238159342a7f1866e0e415
BLAKE2b-256 28640db590de93f3d1b3ada0b22737f59d2ff27b400d45c9ffda95a4196cddae

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.0-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.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for intensify-0.3.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6c71fb31fb5fa5112ba86c8110da9ea877314f3e531942c8b21c1e5337134b0f
MD5 7719c70a2573338ee5875d2c4a328948
BLAKE2b-256 5873696dc7e9db3e7052fd9a10e82640d6e59db1eef25ce2a41d4bd75a036d3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.0-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.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for intensify-0.3.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4d1d62b007a165080ef69d14d859d27cf95bbe5b452f5456348eca09613e7b77
MD5 cba1feae20471093fac02ae246f03f32
BLAKE2b-256 d1cc7f087caa8357d906395d9117494ace395e866224578632f707caaa3dac16

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.0-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.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for intensify-0.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 102aef83829390e20811b863c4760b65ef481c633df81ab96a0196f5974a3fc6
MD5 7d7ea901630d205613b6b38278c52201
BLAKE2b-256 4f5ee85a06bb159e9c34eeecafee9d1733a7013eb95ba5da02ec29997ff95e25

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.0-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.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for intensify-0.3.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6899752849686a7f906971c8eeeee5a9a7d299eda4cd06c8cd5a4c6f3b5a7aa3
MD5 2f035afe1ae3030948151a74e69a24da
BLAKE2b-256 add1f81fb8ed312cf43d7566351b64b372f6523ec060fbe4ba180285c850cb54

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.0-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.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: intensify-0.3.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 329.1 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.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 d19c9b0af7fea56143fdcca179b3c92e9bd6b210d3ee4744d6c84ddeafd2573d
MD5 aaa7546925cb29c788f412ce76c99419
BLAKE2b-256 7d848b0cc25e31a46838738045674a2d636de868213fc7e54437310f3771b3bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.0-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.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for intensify-0.3.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e019306c9b08222aa10ba03755e75e1592eae2f94c64eb13e39ac7dbe7e39019
MD5 53dbc90e98288ce95363fd207d0ecda4
BLAKE2b-256 510ee06306464dd7bca692171a695bd79863518b0e0b6df8def36780d403a130

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.0-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.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for intensify-0.3.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5aa6563889c5e567b39ab028ba0cc744fb3be9fc7fa43fd3dbfcb7a58c448075
MD5 ffc6aa2916291bf6e3022f4850e01b7f
BLAKE2b-256 78743368787e9e04d9fa46f61bdf03ca27068a12fb61c4d161ffb15e7cbc837a

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.0-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.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for intensify-0.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 25afe81d000aab44586415e40ebfab9d3c42c58fc9fc97daf2c8c58c984b3cab
MD5 e844b81e905b42f2046a15fad2e95d9c
BLAKE2b-256 0bfdcd75e48ab993b0de1db39540757653bc76078e4a6914810d2340b7932390

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.0-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.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for intensify-0.3.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 3b9b2893b68f5fff1ee95e7c0bb564f04681f06217253d3dc9f5112e08b232f8
MD5 7cf77bb079136c2a7fb21decb82bff6f
BLAKE2b-256 0aecd9fad7ad8f34fe0d43f6e86f6b3e8ee95edf78b8fbb275c0bd60bc9f76f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.0-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.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: intensify-0.3.0-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.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 98137aef64f72ab0adc53371c4f722e7c49d6dd4ba5ed3d7b90708a94e8ef00b
MD5 40a75a9cce3fd0db33b0479187419052
BLAKE2b-256 efa6a8f6e37ed0d5e53ccda8df15f610cec07036719d99a16ddcd3d5e8b0d1fd

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.0-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.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for intensify-0.3.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d86439cbd437ae5f4966d86f2e89c58f1c7e72d2c8a55a4ef534a6229ed644aa
MD5 34822ab28672ef725203d4425c1aa82f
BLAKE2b-256 f39e966f1fbc96bca7004574267114208afda94de0e0a4f0550c9766e779c11c

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.0-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.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for intensify-0.3.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ca4cc26c54ac471ff6fa95f7d585881b70f388b1a9260e1a60acad0372f63e31
MD5 dd14791cf3a3463c2bb32fd5feb6b2e0
BLAKE2b-256 d340b060380043487c6afee76f86d5f770fe8bd60ec5493cbe52388c28dfd569

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.0-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.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for intensify-0.3.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 6bb4802aeb64e72dc59835d2d80751d868698276a4c7ee1fad47be3ab94268d0
MD5 aeb236ee9bf776df257fca0b5210d043
BLAKE2b-256 bd26a96d3a9dbe147668091b5559e02fdd1c8522b8cb8edc882cc953a9690ed0

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.0-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.0-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for intensify-0.3.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 f4a1367be350d4a351e19e6fb8f8f5c9381f8d6c20e81f5a1030277d8b1618a3
MD5 fb9fa8b57b1f8dd14011a982f699de85
BLAKE2b-256 3923ac8dead1e32e3dd3426ce9bdf07f3660ac263bb7db70324c8839ce4ea2e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for intensify-0.3.0-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