Point Processes — Distributions¶
NumPyro Distribution wrappers around the point-process
operators, so a point process can be used
directly as a likelihood site in an MCMC or SVI model:
Each class mirrors the operator of the same name — the wrapper adds
NumPyro's Distribution interface (log_prob, sample, batch/event shapes)
and nothing else.
Temporal processes¶
NumPyro Distribution wrappers for temporal and spatial point processes.
HomogeneousPoissonProcess(rate: ArrayLike, observation_window: ArrayLike, max_events: int = 512, *, validate_args: bool | None = None)
¶
Bases: Distribution
NumPyro wrapper for a homogeneous temporal Poisson process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rate
|
ArrayLike
|
Intensity |
required |
observation_window
|
ArrayLike
|
Window length |
required |
max_events
|
int
|
Static buffer size for |
512
|
validate_args
|
bool | None
|
Forwarded to |
None
|
Source code in src/xtremax/point_processes/distributions/temporal.py
sample(key: PRNGKeyArray, sample_shape: tuple[int, ...] = ()) -> tuple[Float[Array, ...], Bool[Array, ...]]
¶
Return a (times, mask) PyTree.
This matches the format :meth:log_prob consumes, so
dist.log_prob(dist.sample(key)) is a valid round-trip.
If you need the uncapped Poisson count, call the operator
layer directly or use mask.sum(axis=-1).
Source code in src/xtremax/point_processes/distributions/temporal.py
log_prob(value: tuple[Float[Array, ...], Bool[Array, ...]] | tuple[Float[Array, ...], Int[Array, ...]]) -> Float[Array, ...]
¶
Log-likelihood. value may be (times, mask) or
(times, n_events).
The event times of an HPP drop out of the likelihood, so only the count is used.
Source code in src/xtremax/point_processes/distributions/temporal.py
InhomogeneousPoissonProcess(log_intensity_fn: Callable[[Array], Array], observation_window: ArrayLike, integrated_intensity: ArrayLike | None = None, lambda_max: ArrayLike | None = None, max_candidates: int = 1024, n_integration_points: int = 100, *, validate_args: bool | None = None)
¶
Bases: Distribution
NumPyro wrapper for an inhomogeneous temporal Poisson process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_intensity_fn
|
Callable[[Array], Array]
|
Callable returning |
required |
observation_window
|
ArrayLike
|
Window length. |
required |
integrated_intensity
|
ArrayLike | None
|
:math: |
None
|
lambda_max
|
ArrayLike | None
|
Upper bound on :math: |
None
|
max_candidates
|
int
|
Static buffer for thinning. |
1024
|
n_integration_points
|
int
|
Quadrature nodes. |
100
|
validate_args
|
bool | None
|
Forwarded to |
None
|
Source code in src/xtremax/point_processes/distributions/temporal.py
sample(key: PRNGKeyArray, sample_shape: tuple[int, ...] = ()) -> tuple[Float[Array, ...], Bool[Array, ...]]
¶
Return a (times, mask) PyTree (matching :meth:log_prob).
sample_shape must be empty for now — batched IPP sampling
over an upper-bound λ_max requires a shared buffer size,
which we leave to the operator layer where the user can
vmap explicitly. Drops the uncapped candidate count
returned by the operator; that is available via
mask.sum() for accepted events, or from the operator API
if the raw count matters.
Source code in src/xtremax/point_processes/distributions/temporal.py
log_prob(value: tuple[Float[Array, ...], Bool[Array, ...]]) -> Float[Array, ...]
¶
Log-likelihood value = (event_times, mask).
Source code in src/xtremax/point_processes/distributions/temporal.py
RenewalProcess(inter_event_dist: dist.Distribution, observation_window: ArrayLike, max_events: int = 1024, *, validate_args: bool | None = None)
¶
Bases: Distribution
NumPyro wrapper for a renewal temporal point process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inter_event_dist
|
Distribution
|
NumPyro Distribution for inter-event times. |
required |
observation_window
|
ArrayLike
|
Window length |
required |
max_events
|
int
|
Static buffer size for |
1024
|
validate_args
|
bool | None
|
Forwarded to the |
None
|
Source code in src/xtremax/point_processes/distributions/renewal.py
ExponentialHawkes(mu: ArrayLike, alpha: ArrayLike, beta: ArrayLike, observation_window: ArrayLike, max_events: int = 1024, *, validate_args: bool | None = None)
¶
Bases: Distribution
NumPyro wrapper for an exponential-kernel Hawkes process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
ArrayLike
|
Baseline rate. |
required |
alpha
|
ArrayLike
|
Excitation amplitude. |
required |
beta
|
ArrayLike
|
Excitation decay. |
required |
observation_window
|
ArrayLike
|
Window length. |
required |
max_events
|
int
|
Static buffer for sampling. |
1024
|
Source code in src/xtremax/point_processes/distributions/hawkes.py
GeneralHawkesProcess(mu: ArrayLike, kernel: eqx.Module, observation_window: ArrayLike, max_events: int = 1024, n_integration_points: int = 100, max_kernel_value: ArrayLike | None = None, *, validate_args: bool | None = None)
¶
Bases: Distribution
NumPyro wrapper for a general-kernel Hawkes process.
See :class:~xtremax.point_processes.operators.GeneralHawkesProcess
for the kernel protocol and sampling details.
Source code in src/xtremax/point_processes/distributions/hawkes.py
MarkedTemporalPointProcess(ground: eqx.Module, mark_distribution_fn: Callable[[Array, EventHistory], dist.Distribution], mark_dim: int | None = None, history_at_each_event: bool = True, max_events: int = 1024, *, validate_args: bool | None = None)
¶
Bases: Distribution
NumPyro wrapper for a separable marked temporal point process.
Samples and log-probs consume / return the triple
(times, mask, marks).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ground
|
Module
|
Ground-process operator. |
required |
mark_distribution_fn
|
Callable[[Array, EventHistory], Distribution]
|
|
required |
mark_dim
|
int | None
|
Dimensionality of each mark ( |
None
|
history_at_each_event
|
bool
|
Whether marks see per-event histories. |
True
|
max_events
|
int
|
Static buffer size. |
1024
|
Source code in src/xtremax/point_processes/distributions/marked.py
ThinningProcess(base: eqx.Module, retention_fn: Callable[..., Array], observation_window: ArrayLike | None = None, max_events: int = 1024, n_integration_points: int = 100, *, validate_args: bool | None = None)
¶
Bases: Distribution
NumPyro wrapper for a thinned TPP.
.. warning::
For history-dependent bases (Hawkes, renewal) log_prob is a
pseudo-likelihood — the base intensity is conditioned on
retained events only, while sampling thins a full latent
realisation. Exact for Poisson-family bases; see the operator
module docstring
(:mod:xtremax.point_processes.operators.thinning).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base
|
Module
|
Base temporal operator. |
required |
retention_fn
|
Callable[..., Array]
|
|
required |
observation_window
|
ArrayLike | None
|
Window length. Defaults to the base's. |
None
|
max_events
|
int
|
Static buffer size. |
1024
|
n_integration_points
|
int
|
Trapezoid grid size for the retention compensator. |
100
|
Source code in src/xtremax/point_processes/distributions/thinning.py
sample(key: PRNGKeyArray, sample_shape: tuple[int, ...] = ()) -> tuple[Float[Array, ...], Bool[Array, ...]] | tuple[Float[Array, ...], Bool[Array, ...], Float[Array, ...]]
¶
Return (times, mask) for an unmarked base, or
(times, mask, marks) when the base is a marked process.
The triple matches what :meth:log_prob accepts so that
d.log_prob(d.sample(key)) round-trips for both cases.
Source code in src/xtremax/point_processes/distributions/thinning.py
Spatial processes¶
NumPyro Distribution wrappers for temporal and spatial point processes.
HomogeneousSpatialPP(rate: ArrayLike, domain: RectangularDomain, max_events: int = 512, *, validate_args: bool | None = None)
¶
Bases: Distribution
NumPyro wrapper for a homogeneous spatial Poisson process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rate
|
ArrayLike
|
Intensity |
required |
domain
|
RectangularDomain
|
Rectangular domain. |
required |
max_events
|
int
|
Static buffer size for |
512
|
validate_args
|
bool | None
|
Forwarded to |
None
|
Source code in src/xtremax/point_processes/distributions/hpp_spatial.py
sample(key: PRNGKeyArray, sample_shape: tuple[int, ...] = ()) -> tuple[Float[Array, ...], Bool[Array, ...]]
¶
Return (locations, mask).
Source code in src/xtremax/point_processes/distributions/hpp_spatial.py
log_prob(value: tuple[Float[Array, ...], Bool[Array, ...]] | tuple[Float[Array, ...], Int[Array, ...]]) -> Float[Array, ...]
¶
Joint log-likelihood. value may be (locations, mask) or
(locations, n_events).
Source code in src/xtremax/point_processes/distributions/hpp_spatial.py
InhomogeneousSpatialPP(log_intensity_fn: Callable[[Array], Array], domain: RectangularDomain, integrated_intensity: ArrayLike | None = None, lambda_max: ArrayLike | None = None, max_candidates: int = 1024, n_integration_points: int = 2048, integration_method: SpatialMethod = 'qmc', *, validate_args: bool | None = None)
¶
Bases: Distribution
NumPyro wrapper for an inhomogeneous spatial Poisson process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_intensity_fn
|
Callable[[Array], Array]
|
Log-intensity callable |
required |
domain
|
RectangularDomain
|
Rectangular domain. |
required |
integrated_intensity
|
ArrayLike | None
|
Optional pinned |
None
|
lambda_max
|
ArrayLike | None
|
Optional thinning bound. |
None
|
max_candidates
|
int
|
Static buffer for thinning. |
1024
|
n_integration_points
|
int
|
Quadrature node count. |
2048
|
integration_method
|
SpatialMethod
|
|
'qmc'
|
validate_args
|
bool | None
|
Forwarded to |
None
|
Source code in src/xtremax/point_processes/distributions/ipp_spatial.py
sample(key: PRNGKeyArray, sample_shape: tuple[int, ...] = ()) -> tuple[Float[Array, ...], Bool[Array, ...]]
¶
Return (locations, mask).
Source code in src/xtremax/point_processes/distributions/ipp_spatial.py
log_prob(value: tuple[Float[Array, ...], Bool[Array, ...]]) -> Float[Array, ...]
¶
Log-likelihood Σ log λ(sᵢ) − Λ(D).
MarkedSpatialPP(ground: eqx.Module, mark_distribution_fn: Callable[[Array], dist.Distribution], max_events: int = 1024, mark_dim: int | None = None, *, validate_args: bool | None = None)
¶
Bases: Distribution
NumPyro wrapper for a separable marked spatial Poisson process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ground
|
Module
|
Spatial PP operator ( |
required |
mark_distribution_fn
|
Callable[[Array], Distribution]
|
Callable |
required |
max_events
|
int
|
Static buffer size for |
1024
|
mark_dim
|
int | None
|
Static mark dimensionality ( |
None
|
validate_args
|
bool | None
|
Forwarded to |
None
|
Source code in src/xtremax/point_processes/distributions/marked_spatial.py
sample(key: PRNGKeyArray, sample_shape: tuple[int, ...] = ()) -> tuple[Float[Array, ...], Bool[Array, ...], Float[Array, ...]]
¶
Return (locations, mask, marks).
Sample shapes other than () are not supported here — vmap
over PRNG keys at the operator layer for batched draws.
Source code in src/xtremax/point_processes/distributions/marked_spatial.py
log_prob(value: tuple[Float[Array, ...], Bool[Array, ...], Float[Array, ...]]) -> Float[Array, ...]
¶
Joint log-likelihood log L_ground + Σ log f(mᵢ | sᵢ).
Source code in src/xtremax/point_processes/distributions/marked_spatial.py
Spatiotemporal processes¶
NumPyro Distribution wrappers for temporal and spatial point processes.
HomogeneousSpatioTemporalPP(rate: ArrayLike, spatial: RectangularDomain, temporal: TemporalDomain, max_events: int = 512, *, validate_args: bool | None = None)
¶
Bases: Distribution
NumPyro wrapper for a homogeneous spatiotemporal Poisson process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rate
|
ArrayLike
|
Intensity |
required |
spatial
|
RectangularDomain
|
Spatial domain. |
required |
temporal
|
TemporalDomain
|
Temporal interval. |
required |
max_events
|
int
|
Static buffer size for |
512
|
validate_args
|
bool | None
|
Forwarded to |
None
|
Source code in src/xtremax/point_processes/distributions/hpp_spatiotemporal.py
sample(key: PRNGKeyArray, sample_shape: tuple[int, ...] = ()) -> tuple[Float[Array, ...], Float[Array, ...], Bool[Array, ...]]
¶
Return (locations, times, mask).
Source code in src/xtremax/point_processes/distributions/hpp_spatiotemporal.py
log_prob(value: tuple[Float[Array, ...], Float[Array, ...], Bool[Array, ...]] | tuple[Float[Array, ...], Float[Array, ...], Int[Array, ...]]) -> Float[Array, ...]
¶
Joint log-likelihood. value may be (locations, times, mask)
or (locations, times, n_events).
Source code in src/xtremax/point_processes/distributions/hpp_spatiotemporal.py
InhomogeneousSpatioTemporalPP(log_intensity_fn: Callable[[Array, Array], Array], spatial: RectangularDomain, temporal: TemporalDomain, integrated_intensity: ArrayLike | None = None, lambda_max: ArrayLike | None = None, max_candidates: int = 1024, n_integration_points: int = 4096, integration_method: SpatiotemporalMethod = 'qmc', *, validate_args: bool | None = None)
¶
Bases: Distribution
NumPyro wrapper for an inhomogeneous spatiotemporal Poisson process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_intensity_fn
|
Callable[[Array, Array], Array]
|
Callable |
required |
spatial
|
RectangularDomain
|
Spatial domain. |
required |
temporal
|
TemporalDomain
|
Temporal interval. |
required |
integrated_intensity
|
ArrayLike | None
|
Optional pinned :math: |
None
|
lambda_max
|
ArrayLike | None
|
Optional thinning bound (must be a true upper
bound; the operator raises if neither this nor a
|
None
|
max_candidates
|
int
|
Static thinning buffer. |
1024
|
n_integration_points
|
int
|
Quadrature node count. |
4096
|
integration_method
|
SpatiotemporalMethod
|
|
'qmc'
|
validate_args
|
bool | None
|
Forwarded to |
None
|
Source code in src/xtremax/point_processes/distributions/ipp_spatiotemporal.py
sample(key: PRNGKeyArray, sample_shape: tuple[int, ...] = ()) -> tuple[Float[Array, ...], Float[Array, ...], Bool[Array, ...]]
¶
Return (locations, times, mask).
Source code in src/xtremax/point_processes/distributions/ipp_spatiotemporal.py
log_prob(value: tuple[Float[Array, ...], Float[Array, ...], Bool[Array, ...]]) -> Float[Array, ...]
¶
Log-likelihood :math:\sum_i \log \lambda(s_i, t_i) - \Lambda.
Source code in src/xtremax/point_processes/distributions/ipp_spatiotemporal.py
MarkedSpatioTemporalPP(ground: eqx.Module, mark_distribution_fn: Callable[[Array, Array], dist.Distribution], max_events: int = 1024, mark_dim: int | None = None, *, validate_args: bool | None = None)
¶
Bases: Distribution
NumPyro wrapper for a separable marked spatiotemporal Poisson process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
ground
|
Module
|
Spatiotemporal PP operator
( |
required |
mark_distribution_fn
|
Callable[[Array, Array], Distribution]
|
Callable |
required |
max_events
|
int
|
Static buffer size for |
1024
|
mark_dim
|
int | None
|
Static mark dimensionality ( |
None
|
validate_args
|
bool | None
|
Forwarded to |
None
|
Source code in src/xtremax/point_processes/distributions/marked_spatiotemporal.py
sample(key: PRNGKeyArray, sample_shape: tuple[int, ...] = ()) -> tuple[Float[Array, ...], Float[Array, ...], Bool[Array, ...], Float[Array, ...]]
¶
Return (locations, times, mask, marks).
Source code in src/xtremax/point_processes/distributions/marked_spatiotemporal.py
log_prob(value: tuple[Float[Array, ...], Float[Array, ...], Bool[Array, ...], Float[Array, ...]]) -> Float[Array, ...]
¶
Joint log-likelihood log L_ground + Σ log f(mᵢ | sᵢ, tᵢ).
Source code in src/xtremax/point_processes/distributions/marked_spatiotemporal.py
SpatioTemporalHawkes(mu: ArrayLike, alpha: ArrayLike, beta: ArrayLike, sigma: ArrayLike, spatial: RectangularDomain, temporal: TemporalDomain, max_events: int = 512, boundary_correction: bool = True, *, validate_args: bool | None = None)
¶
Bases: Distribution
NumPyro wrapper for a separable exp-Gaussian spatiotemporal Hawkes process.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mu
|
ArrayLike
|
Baseline rate (scalar > 0). |
required |
alpha
|
ArrayLike
|
Excitation amplitude (scalar; |
required |
beta
|
ArrayLike
|
Temporal decay (scalar > 0). |
required |
sigma
|
ArrayLike
|
Spatial bandwidth (scalar > 0). |
required |
spatial
|
RectangularDomain
|
Spatial domain. |
required |
temporal
|
TemporalDomain
|
Temporal interval. |
required |
max_events
|
int
|
Static buffer for |
512
|
boundary_correction
|
bool
|
Whether the compensator uses the
axis-wise erf-CDF for in-domain spatial-kernel mass
(default |
True
|
validate_args
|
bool | None
|
Forwarded to |
None
|
Source code in src/xtremax/point_processes/distributions/hawkes_spatiotemporal.py
sample(key: PRNGKeyArray, sample_shape: tuple[int, ...] = ()) -> tuple[Float[Array, ...], Float[Array, ...], Bool[Array, ...]]
¶
Return (locations, times, mask).
Source code in src/xtremax/point_processes/distributions/hawkes_spatiotemporal.py
log_prob(value: tuple[Float[Array, ...], Float[Array, ...], Bool[Array, ...]]) -> Float[Array, ...]
¶
Log-likelihood :math:\sum_i \log \lambda^*(s_i, t_i) - \Lambda.