<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/probability/blob/v0.25.0/tensorflow_probability/python/experimental/mcmc/particle_filter_augmentation.py#L87-L128) |

Decorates a transition or proposal fn to track state history.

    tfp.experimental.mcmc.augment_with_state_history(
        fn
    )

For example usage, see
[`tfp.experimental.mcmc.augment_prior_with_state_history`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/mcmc/augment_prior_with_state_history).

<br />

<br />

<br />

| ## Args ||
|---|---|
| `fn` | Python `callable` to wrap, having signature `new_state_dist = fn(step, state_with_history, **kwargs)` where `state_with_history` is a `StateWithHistory` namedtuple. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| `augmented_fn` | Python `callable` wrapping `fn`, having signature `new_state_with_history_dist = augmented_fn(step, state_with_history, **kwargs)`. The return value is a `tfd.JointDistributionNamed` instance over[`tfp.experimental.mcmc.StateWithHistory`](https://www.tensorflow.org/probability/api_docs/python/tfp/experimental/mcmc/StateWithHistory) namedtuples, in which the `state_history` component is rotated to discard the (previously-oldest) state at the initial position and append the new state at the final position. |

<br />