PointProcesses.jl
Welcome to the documentation of PointProcesses.jl, a package for modeling, simulation and inference with temporal point processes.
While there is lots of functionality, certain elements may not be polished, and bugs likely exist. Please report issues on GitHub.
What are Point Processes?
Briefly, point processes are statistical models of random events in time or space. Point processes are parameterized by their intensity functions, or the instantaneous rate in time. A such, these models are useful anytime one is interested in how often one would see an event (e.g., buses arriving, earthquakes occuring, neurons firing.)
Installation
Install the latest release from the General registry:
import Pkg; Pkg.add("PointProcesses")Or install the development version:
import Pkg; Pkg.add(url="https://github.com/JoseKling/PointProcesses.jl")Quick Start
Simulate a Poisson Process
using PointProcesses
# Create a Poisson process with intensity λ = 5.0 events per unit time
pp = PoissonProcess(5.0)
# Simulate events in the interval [0, 10]
history = simulate(pp, 0.0, 10.0)
# Examine the events
event_times(history) # Get event timestamps
nb_events(history) # Count eventsFit a Hawkes Process
using PointProcesses
# Fit a self-exciting Hawkes process to observed data
fitted_hawkes = fit(HawkesProcess, history)
# The fitted process has parameters:
# - μ (mu): baseline intensity
# - α (alpha): excitation magnitude
# - ω (omega): decay rateModel Time-Varying Intensity
using PointProcesses
# Create a process with sinusoidal intensity
intensity_func = SinusoidalIntensity(
amplitude=10.0,
baseline=5.0,
frequency=2π,
phase=0.0
)
ipp = InhomogeneousPoissonProcess(intensity_func)
# Simulate and fit to data
simulated = simulate(ipp, 0.0, 10.0)
fitted_ipp = fit(InhomogeneousPoissonProcess{PolynomialIntensity{2}}, simulated)Available Models
| Model | Description | Parameters |
|---|---|---|
PoissonProcess | Constant intensity (homogeneous) | λ (intensity) |
MultivariatePoissonProcess | Multiple independent streams | λᵢ for each dimension |
InhomogeneousPoissonProcess | Time-varying intensity λ(t) | Varies by intensity function |
HawkesProcess | Self-exciting (clustering) | μ, α, ω |
MarkedPoissonProcess | Events with associated marks | λ, mark distribution |
Parametric Intensity Functions
For inhomogeneous Poisson processes, choose from:
PolynomialIntensity: λ(t) = a₀ + a₁t + a₂t² + ...ExponentialIntensity: λ(t) = a·exp(b·t)SinusoidalIntensity: λ(t) = a + b·sin(ωt + φ)PiecewiseConstantIntensity: Step function (histogram)LinearCovariateIntensity: Log-linear with covariates
Core Workflow
# 1. Create or fit a point process model
pp = PoissonProcess(3.0)
# 2. Simulate event sequences
history = simulate(pp, 0.0, 100.0)
# 3. Fit to observed data
fitted_pp = fit(PoissonProcess, observed_history)
# 4. Validate the model
test = BootstrapTest(KSDistance(Exponential), PoissonProcess, history; n_sims=1000)
pval = pvalue(test) # p-value for goodness-of-fitMathematical Background
Temporal point processes are stochastic models characterized by their conditional intensity function λ(t|ℋₜ), which represents the instantaneous rate of events at time t given the history ℋₜ of events up to that time. .
- (Rasmussen, Jun 2018) – Compact introductory notes on point processes
- (Laub et al., 2021) – More detailed, but still introductory level, material focused on Hawkes processes
- (Daley and Vere-Jones, 2013) – Comprehensive and formal presentation of point processes
Citation
If you use PointProcesses.jl in your research, please cite: