sequince.steps.mutation.metrics.esjd#

Kernel-independent expected squared jump distance.

Classes#

ESJDMetric

Mean squared displacement per attempted particle transition.

Module Contents#

class sequince.steps.mutation.metrics.esjd.ESJDMetric[source]#

Mean squared displacement per attempted particle transition.

Rejections contribute zero. Distances use mutation coordinates (latent coordinates when a transform is configured), without additional whitening or dimension normalization. This measures individual transitions, not the displacement between a complete block’s starting and ending populations.

name defaults to “esjd”; the result is a scalar array. State retains one previous population and scalar totals, without a chain history or additional target evaluations. Optional transition displacements are used when supplied; otherwise consecutive populations supply the displacement. Preparing a new segment resets the previous population but preserves totals, excluding moves between segments. Coordinates must use a consistent metric for the accumulated average to be meaningful.

name: str = 'esjd'#
initialize(particles, log_weights, context)[source]#

Initialize the previous population and scalar totals.

Parameters:
Return type:

tuple[sequince.typing.Array, sequince.typing.Array, sequince.typing.Array]

prepare(state, particles, context)[source]#

Preserve totals while excluding inter-segment particle changes.

Parameters:
Return type:

tuple[sequince.typing.Array, sequince.typing.Array, sequince.typing.Array]

update(state, particles, accepted, context, *, transition=None)[source]#

Accumulate squared movement and count all attempted transitions.

Parameters:
Return type:

tuple[sequince.typing.Array, sequince.typing.Array, sequince.typing.Array]

result(state, context)[source]#

Return ESJD, or zero when no transitions were recorded.

Parameters:
Return type:

sequince.typing.Array