GibbsKernel.with_transition_fn()

GibbsKernel.with_transition_fn()#

classmethod GibbsKernel.with_transition_fn(transition_fn)[source]#

Return a Gibbs kernel factory with a fixed transition function.

This helper is useful when a Gibbs kernel should be configured through an MCMCSpec. The returned callable accepts the position keys and an optional identifier, matching the kernel factory interface expected by LieselMCMC.

Parameters:

transition_fn (Callable[[Any, Any], Position (dict[str, Any])]) – Function implementing one Gibbs update. It receives a PRNG key and the current model state, and must return a position dictionary with updated values for the variables handled by the kernel.

Return type:

Callable[[Sequence[str], str], GibbsKernel]

Returns:

Callable – A kernel factory that creates GibbsKernel instances for a given sequence of position keys.