sequince.steps.mutation.metrics.esjd
====================================

.. py:module:: sequince.steps.mutation.metrics.esjd

.. autoapi-nested-parse::

   Kernel-independent expected squared jump distance.



Classes
-------

.. autoapisummary::

   sequince.steps.mutation.metrics.esjd.ESJDMetric


Module Contents
---------------

.. py:class:: ESJDMetric

   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.


   .. py:attribute:: name
      :type:  str
      :value: 'esjd'



   .. py:method:: initialize(particles, log_weights, context)

      Initialize the previous population and scalar totals.



   .. py:method:: prepare(state, particles, context)

      Preserve totals while excluding inter-segment particle changes.



   .. py:method:: update(state, particles, accepted, context, *, transition = None)

      Accumulate squared movement and count all attempted transitions.



   .. py:method:: result(state, context)

      Return ESJD, or zero when no transitions were recorded.



