Point Processes — Overview¶
Shared infrastructure for the point-process stack. The three tiers built on
top of this live on their own pages —
primitives (pure functions),
operators (equinox.Module objects), and
distributions (NumPyro likelihoods).
Everything here is fixed-size by design: JAX needs static shapes, so event sequences are stored in padded buffers with a companion boolean mask rather than as ragged arrays. That mask threads through every likelihood and sampler in the package.
Domains¶
The observation window. Its measure appears directly in every likelihood — the compensator term is an integral over exactly this region — so getting it right matters as much as the intensity itself.
Point processes for xtremax.
Three layers, mirroring the rest of the package:
- :mod:
~xtremax.point_processes.primitives— pure functions (no equinox). These take a NumPyro Distribution as the inter-event / mark law where relevant; they never depend on the NumPyro Distribution base machinery (sample / log_prob / cdf is used directly). - :mod:
~xtremax.point_processes.operators—equinox.Moduleclasses that bundle intensity specs with numerical defaults. The primary user-facing API. - :mod:
~xtremax.point_processes.distributions— thinnumpyro.distributions.Distributionwrappers around the operators so these processes can appear inside NumPyro models.
Families currently available:
- Homogeneous Poisson (
HomogeneousPoissonProcess). - Inhomogeneous Poisson (
InhomogeneousPoissonProcess). - Renewal (
RenewalProcess) — any NumPyro inter-event distribution. - Self-exciting Hawkes (
ExponentialHawkes,GeneralHawkesProcess). - Marked (
MarkedTemporalPointProcess) — ground × mark-distribution. - Thinning (
ThinningProcess) — base TPP × retention callable.
Padded-buffer invariant¶
Every padded event sequence in this package satisfies: the mask is a
contiguous prefix (mask == [True]*n + [False]*(max-n)) and
padding times sit at the right edge of the window (T; spatial
padding rows at domain.lo). All samplers emit sequences in this
form — thinning-based samplers compact accepted events before
returning — and consumers with sequential structure
(time_rescaling_residuals, exp_hawkes_log_prob via Ozaki gaps,
renewal_log_prob via gap differences) assume it. Hand-constructed
inputs with hole masks are supported only where a function explicitly
documents mask-robust behaviour.
The shared :class:~xtremax.point_processes._history.EventHistory
pytree is the lingua franca for user-supplied retention and mark
callables: every family threads history through in the same shape so
user code need not know the underlying family.
Sample-result convention¶
Every sampler returns a NamedTuple from
:mod:~xtremax.point_processes._results —
:class:SampleResult (times, mask, n_events) for unmarked temporal
processes, :class:MarkedSampleResult (times, mask, marks) for
marked ones, and the spatial/spatiotemporal analogues. These unpack
positionally exactly like the tuples they replaced, are valid JAX
pytrees, and let wrapper operators dispatch on the result type
instead of shape/dtype heuristics. The n_events semantics are
family-specific and documented per sampler (HPP: uncapped event count;
thinning IPPs: uncapped candidate count; Hawkes: proposals consumed;
renewal: retained events). sample_shape batching exists only on the
temporal HPP; batch every other sampler with jax.vmap /
equinox.filter_vmap over keys.
Operator architecture¶
Cross-family operator surface lives once in
:mod:~xtremax.point_processes.operators._base: the time-rescaling
diagnostics trio (residuals / goodness_of_fit /
compensator_curve) in GoodnessOfFitMixin (families supply only
_compensator_fn), the live-λ_max accessor in
LiveIntensityMixin, and the separable marked-process plumbing in
SeparableMarkedPP.
TemporalDomain(t0: ArrayLike, t1: ArrayLike)
¶
Bases: Module
Half-open temporal interval [t0, t1) ⊂ ℝ.
Parallel to :class:RectangularDomain but specialised to one
causally-ordered axis. Used by spatiotemporal point processes so the
time domain stays explicit ([t0, t1) instead of an implicit
[0, T]) and so callers can shift the origin without re-deriving
quadrature offsets.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
t0
|
ArrayLike
|
Inclusive start time. |
required |
t1
|
ArrayLike
|
Exclusive end time. Must satisfy |
required |
Source code in src/xtremax/point_processes/_domain.py
duration: Float[Array, ...]
property
¶
Length of the interval t1 - t0.
from_duration(duration: ArrayLike) -> TemporalDomain
classmethod
¶
Interval anchored at zero: t0 = 0, t1 = duration.
Mirrors the source-snippet convention where users pass an
observation_window scalar directly.
Source code in src/xtremax/point_processes/_domain.py
volume() -> Float[Array, ...]
¶
Lebesgue measure of the interval — alias for :attr:duration.
Provided for API symmetry with :class:RectangularDomain so
joint-domain code can call spatial.volume() * temporal.volume()
without special-casing the temporal axis.
Source code in src/xtremax/point_processes/_domain.py
contains(t: Float[Array, ...]) -> Array
¶
sample_uniform(key: PRNGKeyArray, shape: tuple[int, ...] = ()) -> Float[Array, ...]
¶
Draw uniform times in the interval.
Output shape is exactly shape; no trailing dimension axis,
because time is scalar.
Source code in src/xtremax/point_processes/_domain.py
RectangularDomain(lo: ArrayLike, hi: ArrayLike)
¶
Bases: Module
Axis-aligned rectangle [lo, hi] ⊂ ℝᵈ.
Both lo and hi are real PyTree leaves so the domain can
be vmapped over (e.g. for batches with different bounding boxes)
and so that, in principle, the bounds could be optimised through
gradient descent.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lo
|
ArrayLike
|
Lower corner |
required |
hi
|
ArrayLike
|
Upper corner |
required |
Notes
The convention is half-open [lo, hi) for sampling — the
upper edge has measure zero so any choice is fine, but uniform
draws on [lo, hi) are the natural pairing with lo + U·side.
Source code in src/xtremax/point_processes/_domain.py
n_dims: int
property
¶
Spatial dimension d.
Static at PyTree-construction time so callers can use it as a
Python int (e.g. for kernel-grid construction).
side_lengths: Float[Array, ...]
property
¶
Per-axis box widths hi - lo with shape (d,).
from_size(size: ArrayLike) -> RectangularDomain
classmethod
¶
Box anchored at the origin: lo = 0, hi = size.
Mirrors the source-snippet convention where users pass a
domain_size array directly. Always returns a 1-D hi
array even for scalar input.
Source code in src/xtremax/point_processes/_domain.py
volume() -> Float[Array, ...]
¶
contains(x: Float[Array, ...]) -> Array
¶
Boolean True where every coordinate lies in the half-open box.
sample_uniform(key: PRNGKeyArray, shape: tuple[int, ...] = ()) -> Float[Array, ...]
¶
Draw uniform points in the box.
The output shape is shape + (d,) — shape is the leading
sample/batch axes and d is the spatial dimension.
Source code in src/xtremax/point_processes/_domain.py
Event history¶
The conditioning buffer for self-exciting processes: which events have already happened, and (optionally) their marks. Hawkes intensities read from this.
Point processes for xtremax.
Three layers, mirroring the rest of the package:
- :mod:
~xtremax.point_processes.primitives— pure functions (no equinox). These take a NumPyro Distribution as the inter-event / mark law where relevant; they never depend on the NumPyro Distribution base machinery (sample / log_prob / cdf is used directly). - :mod:
~xtremax.point_processes.operators—equinox.Moduleclasses that bundle intensity specs with numerical defaults. The primary user-facing API. - :mod:
~xtremax.point_processes.distributions— thinnumpyro.distributions.Distributionwrappers around the operators so these processes can appear inside NumPyro models.
Families currently available:
- Homogeneous Poisson (
HomogeneousPoissonProcess). - Inhomogeneous Poisson (
InhomogeneousPoissonProcess). - Renewal (
RenewalProcess) — any NumPyro inter-event distribution. - Self-exciting Hawkes (
ExponentialHawkes,GeneralHawkesProcess). - Marked (
MarkedTemporalPointProcess) — ground × mark-distribution. - Thinning (
ThinningProcess) — base TPP × retention callable.
Padded-buffer invariant¶
Every padded event sequence in this package satisfies: the mask is a
contiguous prefix (mask == [True]*n + [False]*(max-n)) and
padding times sit at the right edge of the window (T; spatial
padding rows at domain.lo). All samplers emit sequences in this
form — thinning-based samplers compact accepted events before
returning — and consumers with sequential structure
(time_rescaling_residuals, exp_hawkes_log_prob via Ozaki gaps,
renewal_log_prob via gap differences) assume it. Hand-constructed
inputs with hole masks are supported only where a function explicitly
documents mask-robust behaviour.
The shared :class:~xtremax.point_processes._history.EventHistory
pytree is the lingua franca for user-supplied retention and mark
callables: every family threads history through in the same shape so
user code need not know the underlying family.
Sample-result convention¶
Every sampler returns a NamedTuple from
:mod:~xtremax.point_processes._results —
:class:SampleResult (times, mask, n_events) for unmarked temporal
processes, :class:MarkedSampleResult (times, mask, marks) for
marked ones, and the spatial/spatiotemporal analogues. These unpack
positionally exactly like the tuples they replaced, are valid JAX
pytrees, and let wrapper operators dispatch on the result type
instead of shape/dtype heuristics. The n_events semantics are
family-specific and documented per sampler (HPP: uncapped event count;
thinning IPPs: uncapped candidate count; Hawkes: proposals consumed;
renewal: retained events). sample_shape batching exists only on the
temporal HPP; batch every other sampler with jax.vmap /
equinox.filter_vmap over keys.
Operator architecture¶
Cross-family operator surface lives once in
:mod:~xtremax.point_processes.operators._base: the time-rescaling
diagnostics trio (residuals / goodness_of_fit /
compensator_curve) in GoodnessOfFitMixin (families supply only
_compensator_fn), the live-λ_max accessor in
LiveIntensityMixin, and the separable marked-process plumbing in
SeparableMarkedPP.
EventHistory
¶
Bases: Module
Fixed-size buffer of events + optional marks.
Attributes:
| Name | Type | Description |
|---|---|---|
times |
Float[Array, ...]
|
Sorted event times with padding positions (typically) at the right edge of the observation window. |
mask |
Bool[Array, ...]
|
|
marks |
Float[Array, ...] | None
|
Optional marks aligned with |
empty(max_events: int, mark_dim: int | None = None, dtype: jnp.dtype = jnp.float32, mark_dtype: jnp.dtype | None = None) -> EventHistory
classmethod
¶
Buffer with no events yet: all times 0, mask all False.
mark_dtype sets the marks-buffer dtype independently of the
times dtype (defaults to dtype) — discrete marks would
otherwise be silently cast to float.
Source code in src/xtremax/point_processes/_history.py
n_events() -> Int[Array, ...]
¶
last_time(default: float | Float[Array, ...] = 0.0) -> Float[Array, ...]
¶
Most recent real event time, or default if the history is empty.
Uses the mask directly rather than indexing by count, so it is
safe under jit without triggering a dynamic gather.
Source code in src/xtremax/point_processes/_history.py
time_since_last(t: Float[Array, ...], default: float | Float[Array, ...] = 0.0) -> Float[Array, ...]
¶
t - last_time with default returned for empty history.
Source code in src/xtremax/point_processes/_history.py
append(t: Float[Array, ...], mark: Float[Array, ...] | None = None, *, accepted: Bool[Array, ...] | bool = True) -> EventHistory
¶
Return a new history with t appended if accepted.
Writes at position n_events(); a False accepted or an
overrun past the buffer is a no-op so the routine stays shape-
and jit-stable. Callers that care about overruns can compare
n_events() before/after.
Source code in src/xtremax/point_processes/_history.py
Sample results¶
What the samplers return: padded event arrays plus the mask that says which entries are real. One type per event geometry (temporal / spatial / spatiotemporal), each with a marked counterpart that carries the mark array alongside.
Point processes for xtremax.
Three layers, mirroring the rest of the package:
- :mod:
~xtremax.point_processes.primitives— pure functions (no equinox). These take a NumPyro Distribution as the inter-event / mark law where relevant; they never depend on the NumPyro Distribution base machinery (sample / log_prob / cdf is used directly). - :mod:
~xtremax.point_processes.operators—equinox.Moduleclasses that bundle intensity specs with numerical defaults. The primary user-facing API. - :mod:
~xtremax.point_processes.distributions— thinnumpyro.distributions.Distributionwrappers around the operators so these processes can appear inside NumPyro models.
Families currently available:
- Homogeneous Poisson (
HomogeneousPoissonProcess). - Inhomogeneous Poisson (
InhomogeneousPoissonProcess). - Renewal (
RenewalProcess) — any NumPyro inter-event distribution. - Self-exciting Hawkes (
ExponentialHawkes,GeneralHawkesProcess). - Marked (
MarkedTemporalPointProcess) — ground × mark-distribution. - Thinning (
ThinningProcess) — base TPP × retention callable.
Padded-buffer invariant¶
Every padded event sequence in this package satisfies: the mask is a
contiguous prefix (mask == [True]*n + [False]*(max-n)) and
padding times sit at the right edge of the window (T; spatial
padding rows at domain.lo). All samplers emit sequences in this
form — thinning-based samplers compact accepted events before
returning — and consumers with sequential structure
(time_rescaling_residuals, exp_hawkes_log_prob via Ozaki gaps,
renewal_log_prob via gap differences) assume it. Hand-constructed
inputs with hole masks are supported only where a function explicitly
documents mask-robust behaviour.
The shared :class:~xtremax.point_processes._history.EventHistory
pytree is the lingua franca for user-supplied retention and mark
callables: every family threads history through in the same shape so
user code need not know the underlying family.
Sample-result convention¶
Every sampler returns a NamedTuple from
:mod:~xtremax.point_processes._results —
:class:SampleResult (times, mask, n_events) for unmarked temporal
processes, :class:MarkedSampleResult (times, mask, marks) for
marked ones, and the spatial/spatiotemporal analogues. These unpack
positionally exactly like the tuples they replaced, are valid JAX
pytrees, and let wrapper operators dispatch on the result type
instead of shape/dtype heuristics. The n_events semantics are
family-specific and documented per sampler (HPP: uncapped event count;
thinning IPPs: uncapped candidate count; Hawkes: proposals consumed;
renewal: retained events). sample_shape batching exists only on the
temporal HPP; batch every other sampler with jax.vmap /
equinox.filter_vmap over keys.
Operator architecture¶
Cross-family operator surface lives once in
:mod:~xtremax.point_processes.operators._base: the time-rescaling
diagnostics trio (residuals / goodness_of_fit /
compensator_curve) in GoodnessOfFitMixin (families supply only
_compensator_fn), the live-λ_max accessor in
LiveIntensityMixin, and the separable marked-process plumbing in
SeparableMarkedPP.
SampleResult
¶
Bases: NamedTuple
Unmarked temporal sample: (times, mask, n_events).
SpatialSampleResult
¶
Bases: NamedTuple
Unmarked spatial sample: (locations, mask, n_events).
SpatiotemporalSampleResult
¶
Bases: NamedTuple
Unmarked spatiotemporal sample: (locations, times, mask, n_events).
MarkedSampleResult
¶
Bases: NamedTuple
Marked temporal sample: (times, mask, marks).
Three fields (not four) so it unpacks identically to the tuple it
replaces; the retained-event count is mask.sum().
MarkedSpatialSampleResult
¶
Bases: NamedTuple
Marked spatial sample: (locations, mask, marks).
MarkedSpatiotemporalSampleResult
¶
Bases: NamedTuple
Marked spatiotemporal sample: (locations, times, mask, marks).
Goodness of fit¶
The bundle returned by the temporal operators' goodness_of_fit method —
time-rescaled residuals plus the KS statistic and QQ quantiles computed from
them.
Point processes for xtremax.
Three layers, mirroring the rest of the package:
- :mod:
~xtremax.point_processes.primitives— pure functions (no equinox). These take a NumPyro Distribution as the inter-event / mark law where relevant; they never depend on the NumPyro Distribution base machinery (sample / log_prob / cdf is used directly). - :mod:
~xtremax.point_processes.operators—equinox.Moduleclasses that bundle intensity specs with numerical defaults. The primary user-facing API. - :mod:
~xtremax.point_processes.distributions— thinnumpyro.distributions.Distributionwrappers around the operators so these processes can appear inside NumPyro models.
Families currently available:
- Homogeneous Poisson (
HomogeneousPoissonProcess). - Inhomogeneous Poisson (
InhomogeneousPoissonProcess). - Renewal (
RenewalProcess) — any NumPyro inter-event distribution. - Self-exciting Hawkes (
ExponentialHawkes,GeneralHawkesProcess). - Marked (
MarkedTemporalPointProcess) — ground × mark-distribution. - Thinning (
ThinningProcess) — base TPP × retention callable.
Padded-buffer invariant¶
Every padded event sequence in this package satisfies: the mask is a
contiguous prefix (mask == [True]*n + [False]*(max-n)) and
padding times sit at the right edge of the window (T; spatial
padding rows at domain.lo). All samplers emit sequences in this
form — thinning-based samplers compact accepted events before
returning — and consumers with sequential structure
(time_rescaling_residuals, exp_hawkes_log_prob via Ozaki gaps,
renewal_log_prob via gap differences) assume it. Hand-constructed
inputs with hole masks are supported only where a function explicitly
documents mask-robust behaviour.
The shared :class:~xtremax.point_processes._history.EventHistory
pytree is the lingua franca for user-supplied retention and mark
callables: every family threads history through in the same shape so
user code need not know the underlying family.
Sample-result convention¶
Every sampler returns a NamedTuple from
:mod:~xtremax.point_processes._results —
:class:SampleResult (times, mask, n_events) for unmarked temporal
processes, :class:MarkedSampleResult (times, mask, marks) for
marked ones, and the spatial/spatiotemporal analogues. These unpack
positionally exactly like the tuples they replaced, are valid JAX
pytrees, and let wrapper operators dispatch on the result type
instead of shape/dtype heuristics. The n_events semantics are
family-specific and documented per sampler (HPP: uncapped event count;
thinning IPPs: uncapped candidate count; Hawkes: proposals consumed;
renewal: retained events). sample_shape batching exists only on the
temporal HPP; batch every other sampler with jax.vmap /
equinox.filter_vmap over keys.
Operator architecture¶
Cross-family operator surface lives once in
:mod:~xtremax.point_processes.operators._base: the time-rescaling
diagnostics trio (residuals / goodness_of_fit /
compensator_curve) in GoodnessOfFitMixin (families supply only
_compensator_fn), the live-λ_max accessor in
LiveIntensityMixin, and the separable marked-process plumbing in
SeparableMarkedPP.
GoodnessOfFit
¶
Bases: NamedTuple
Bundle of diagnostics returned by goodness_of_fit.
Attributes:
| Name | Type | Description |
|---|---|---|
residuals |
Float[Array, ...]
|
Time-rescaled inter-event residuals :math: |
mask |
Bool[Array, ...]
|
Real-event mask aligned with |
ks_statistic |
Float[Array, ...]
|
Kolmogorov–Smirnov statistic versus |
theoretical_quantiles |
Float[Array, ...]
|
QQ-plot theoretical quantiles. |
empirical_quantiles |
Float[Array, ...]
|
QQ-plot empirical quantiles. |
Marks & retention builders¶
Small adapters that lift a simple callable into the full
(coords, history) -> Distribution signature the marked and thinned processes
expect — so a constant mark distribution or a time-varying retention
probability doesn't require writing the whole closure by hand.
Point processes for xtremax.
Three layers, mirroring the rest of the package:
- :mod:
~xtremax.point_processes.primitives— pure functions (no equinox). These take a NumPyro Distribution as the inter-event / mark law where relevant; they never depend on the NumPyro Distribution base machinery (sample / log_prob / cdf is used directly). - :mod:
~xtremax.point_processes.operators—equinox.Moduleclasses that bundle intensity specs with numerical defaults. The primary user-facing API. - :mod:
~xtremax.point_processes.distributions— thinnumpyro.distributions.Distributionwrappers around the operators so these processes can appear inside NumPyro models.
Families currently available:
- Homogeneous Poisson (
HomogeneousPoissonProcess). - Inhomogeneous Poisson (
InhomogeneousPoissonProcess). - Renewal (
RenewalProcess) — any NumPyro inter-event distribution. - Self-exciting Hawkes (
ExponentialHawkes,GeneralHawkesProcess). - Marked (
MarkedTemporalPointProcess) — ground × mark-distribution. - Thinning (
ThinningProcess) — base TPP × retention callable.
Padded-buffer invariant¶
Every padded event sequence in this package satisfies: the mask is a
contiguous prefix (mask == [True]*n + [False]*(max-n)) and
padding times sit at the right edge of the window (T; spatial
padding rows at domain.lo). All samplers emit sequences in this
form — thinning-based samplers compact accepted events before
returning — and consumers with sequential structure
(time_rescaling_residuals, exp_hawkes_log_prob via Ozaki gaps,
renewal_log_prob via gap differences) assume it. Hand-constructed
inputs with hole masks are supported only where a function explicitly
documents mask-robust behaviour.
The shared :class:~xtremax.point_processes._history.EventHistory
pytree is the lingua franca for user-supplied retention and mark
callables: every family threads history through in the same shape so
user code need not know the underlying family.
Sample-result convention¶
Every sampler returns a NamedTuple from
:mod:~xtremax.point_processes._results —
:class:SampleResult (times, mask, n_events) for unmarked temporal
processes, :class:MarkedSampleResult (times, mask, marks) for
marked ones, and the spatial/spatiotemporal analogues. These unpack
positionally exactly like the tuples they replaced, are valid JAX
pytrees, and let wrapper operators dispatch on the result type
instead of shape/dtype heuristics. The n_events semantics are
family-specific and documented per sampler (HPP: uncapped event count;
thinning IPPs: uncapped candidate count; Hawkes: proposals consumed;
renewal: retained events). sample_shape batching exists only on the
temporal HPP; batch every other sampler with jax.vmap /
equinox.filter_vmap over keys.
Operator architecture¶
Cross-family operator surface lives once in
:mod:~xtremax.point_processes.operators._base: the time-rescaling
diagnostics trio (residuals / goodness_of_fit /
compensator_curve) in GoodnessOfFitMixin (families supply only
_compensator_fn), the live-λ_max accessor in
LiveIntensityMixin, and the separable marked-process plumbing in
SeparableMarkedPP.
constant_mark_distribution(d: dist.Distribution) -> Callable[[Float[Array, ...], EventHistory], dist.Distribution]
¶
Mark distribution that ignores time and history and returns d.
Source code in src/xtremax/point_processes/_adapters.py
time_varying_marks(fn: Callable[[Float[Array, ...]], dist.Distribution]) -> Callable[[Float[Array, ...], EventHistory], dist.Distribution]
¶
Wrap a time → Distribution callable into the full signature.
Source code in src/xtremax/point_processes/_adapters.py
constant_retention(p: float | Float[Array, ...]) -> Callable[[Float[Array, ...], EventHistory, Float[Array, ...] | None], Array]
¶
Retention that always returns the same probability p.
Source code in src/xtremax/point_processes/_adapters.py
time_varying_retention(fn: Callable[[Float[Array, ...]], Float[Array, ...]]) -> Callable[[Float[Array, ...], EventHistory, Float[Array, ...] | None], Array]
¶
Wrap a pure function of time into the full retention signature.
Source code in src/xtremax/point_processes/_adapters.py
Log-intensity integration¶
Quadrature for the compensator \(\Lambda = \int \exp(\log \lambda)\) over each domain type. Intensities are parameterised in log space for positivity, so these integrate the exponential rather than the callable directly.
Point processes for xtremax.
Three layers, mirroring the rest of the package:
- :mod:
~xtremax.point_processes.primitives— pure functions (no equinox). These take a NumPyro Distribution as the inter-event / mark law where relevant; they never depend on the NumPyro Distribution base machinery (sample / log_prob / cdf is used directly). - :mod:
~xtremax.point_processes.operators—equinox.Moduleclasses that bundle intensity specs with numerical defaults. The primary user-facing API. - :mod:
~xtremax.point_processes.distributions— thinnumpyro.distributions.Distributionwrappers around the operators so these processes can appear inside NumPyro models.
Families currently available:
- Homogeneous Poisson (
HomogeneousPoissonProcess). - Inhomogeneous Poisson (
InhomogeneousPoissonProcess). - Renewal (
RenewalProcess) — any NumPyro inter-event distribution. - Self-exciting Hawkes (
ExponentialHawkes,GeneralHawkesProcess). - Marked (
MarkedTemporalPointProcess) — ground × mark-distribution. - Thinning (
ThinningProcess) — base TPP × retention callable.
Padded-buffer invariant¶
Every padded event sequence in this package satisfies: the mask is a
contiguous prefix (mask == [True]*n + [False]*(max-n)) and
padding times sit at the right edge of the window (T; spatial
padding rows at domain.lo). All samplers emit sequences in this
form — thinning-based samplers compact accepted events before
returning — and consumers with sequential structure
(time_rescaling_residuals, exp_hawkes_log_prob via Ozaki gaps,
renewal_log_prob via gap differences) assume it. Hand-constructed
inputs with hole masks are supported only where a function explicitly
documents mask-robust behaviour.
The shared :class:~xtremax.point_processes._history.EventHistory
pytree is the lingua franca for user-supplied retention and mark
callables: every family threads history through in the same shape so
user code need not know the underlying family.
Sample-result convention¶
Every sampler returns a NamedTuple from
:mod:~xtremax.point_processes._results —
:class:SampleResult (times, mask, n_events) for unmarked temporal
processes, :class:MarkedSampleResult (times, mask, marks) for
marked ones, and the spatial/spatiotemporal analogues. These unpack
positionally exactly like the tuples they replaced, are valid JAX
pytrees, and let wrapper operators dispatch on the result type
instead of shape/dtype heuristics. The n_events semantics are
family-specific and documented per sampler (HPP: uncapped event count;
thinning IPPs: uncapped candidate count; Hawkes: proposals consumed;
renewal: retained events). sample_shape batching exists only on the
temporal HPP; batch every other sampler with jax.vmap /
equinox.filter_vmap over keys.
Operator architecture¶
Cross-family operator surface lives once in
:mod:~xtremax.point_processes.operators._base: the time-rescaling
diagnostics trio (residuals / goodness_of_fit /
compensator_curve) in GoodnessOfFitMixin (families supply only
_compensator_fn), the live-λ_max accessor in
LiveIntensityMixin, and the separable marked-process plumbing in
SeparableMarkedPP.
cumulative_log_intensity(log_intensity_fn: Callable[[Float[Array, ...]], Float[Array, ...]], t: Float[Array, ...], n_points: int = 100, method: Method = 'trapezoid') -> Float[Array, ...]
¶
Shorthand for :math:\Lambda(t) = \int_0^t \lambda(s) ds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_intensity_fn
|
Callable[[Float[Array, ...]], Float[Array, ...]]
|
Log-intensity callable (see
:func: |
required |
t
|
Float[Array, ...]
|
Upper limit(s). Must be |
required |
n_points
|
int
|
Quadrature nodes. |
100
|
method
|
Method
|
Quadrature rule. |
'trapezoid'
|
Returns:
| Type | Description |
|---|---|
Float[Array, ...]
|
Cumulative intensity with the same shape as |
Source code in src/xtremax/point_processes/_integration.py
integrate_log_intensity(log_intensity_fn: Callable[[Float[Array, ...]], Float[Array, ...]], t0: Float[Array, ...], t1: Float[Array, ...], n_points: int = 100, method: Method = 'trapezoid') -> Float[Array, ...]
¶
Compute :math:\int_{t_0}^{t_1} \exp(\log\lambda(s))\, ds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_intensity_fn
|
Callable[[Float[Array, ...]], Float[Array, ...]]
|
Callable mapping a 1-D |
required |
t0
|
Float[Array, ...]
|
Lower limit (scalar or batched). Broadcast against |
required |
t1
|
Float[Array, ...]
|
Upper limit (scalar or batched). Broadcast against |
required |
n_points
|
int
|
Number of quadrature nodes (static Python int). Must
be |
100
|
method
|
Method
|
Quadrature rule — |
'trapezoid'
|
Returns:
| Type | Description |
|---|---|
Float[Array, ...]
|
Array with shape |
Notes
For batched limits, each pair :math:(t_0^{(i)}, t_1^{(i)})
gets its own linspace grid via vmap; the user's
log_intensity_fn only ever sees a 1-D grid of times.
Source code in src/xtremax/point_processes/_integration.py
integrate_log_intensity_spatial(log_intensity_fn: Callable[[Float[Array, ...]], Float[Array, ...]], domain: RectangularDomain, n_points: int = 2048, method: SpatialMethod = 'qmc') -> Float[Array, ...]
¶
Compute :math:\int_D \exp(\log\lambda(s))\, ds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_intensity_fn
|
Callable[[Float[Array, ...]], Float[Array, ...]]
|
Callable mapping |
required |
domain
|
RectangularDomain
|
Spatial domain over which to integrate. |
required |
n_points
|
int
|
Static number of quadrature/QMC nodes. For
|
2048
|
method
|
SpatialMethod
|
|
'qmc'
|
Returns:
| Type | Description |
|---|---|
Float[Array, ...]
|
Scalar Λ, differentiable through |
Float[Array, ...]
|
parameters. |
Notes
Both methods are deterministic given a fixed n_points —
no PRNG key is needed. QMC uses a digit-reversed Halton
sequence on the first d primes, which is reproducible and
avoids the wrap-around bias of plain MC.
Source code in src/xtremax/point_processes/_integration_spatial.py
integrate_log_intensity_spatiotemporal(log_intensity_fn: Callable[[Float[Array, ...], Float[Array, ...]], Float[Array, ...]], spatial: RectangularDomain, temporal: TemporalDomain, n_points: int = 4096, method: SpatiotemporalMethod = 'qmc') -> Float[Array, ...]
¶
Compute :math:\int_{t_0}^{t_1} \int_D \exp(\log\lambda(s, t))\, ds\, dt.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
log_intensity_fn
|
Callable[[Float[Array, ...], Float[Array, ...]], Float[Array, ...]]
|
Callable |
required |
spatial
|
RectangularDomain
|
Spatial domain. |
required |
temporal
|
TemporalDomain
|
Temporal interval. |
required |
n_points
|
int
|
Static node budget across all |
4096
|
method
|
SpatiotemporalMethod
|
|
'qmc'
|
Returns:
| Name | Type | Description |
|---|---|---|
Scalar |
Float[Array, ...]
|
math: |
Float[Array, ...]
|
|