jexplore.steps.rwalk ==================== .. py:module:: jexplore.steps.rwalk .. autoapi-nested-parse:: This module contains definitions of Metropolis-Hasting all chains steps with random walks proposals. Classes ------- .. autoapisummary:: jexplore.steps.rwalk.MVRandomWalk jexplore.steps.rwalk.GaussianRandomWalk jexplore.steps.rwalk.StudentTRandomWalk Module Contents --------------- .. py:class:: MVRandomWalk(dist, mask = None, scale = 1.19, **opts) Bases: :py:obj:`jexplore.steps.direct.Direct` Generic multivariate random walk proposal. :param dist: distribution class :param mask: proposal dimensions mask (default all space) :param scale: random walk scaling factor. :param \**opts: options to be passed to the distribution creator. .. py:attribute:: lower :type: jax.Array covariance cholesky decomposition matrices `(nchains, dim, dim)`. .. py:attribute:: cd_const :type: jax.Array effective scaling factor. This is the `scale` attribute divided by the square root of the space dimensionality. .. py:attribute:: scale :type: float random walk scaling factor. .. py:method:: build(epoch) Step epoch initialisation method. This extends method :py:attr:`jexplore.steps.step.Step.build` by defining the `lower` and `cd_const` attributes. `epoch` and `sampling` attributes. :param epoch: current epoch. .. py:method:: proposal(key, state) Samples from :py:attr:`jexplore.steps.rwalk.MVRandomWalk.epoch_dist` are used to perform random walk steps on all chains. :param key: PRNG key used as the random key. :param state: a (nwalkers * ntemps, dim) array representing the state point of the MCMC sampler. This corresponds to the :py:attr:`jexplore.sampling.state.State.p` attribute of a :py:attr:`jexplore.sampling.state.State` object. :return: the updated PRNG key, the new state point (nwalkers * ntemps, dim) and a (nwalkers *ntemps) array with the log of the ratio between the backward and the forward transition probabilities. .. py:class:: GaussianRandomWalk(mask = None) Bases: :py:obj:`MVRandomWalk` Gaussian random walk proposal. :param mask: proposal dimensions mask (default all space) .. py:class:: StudentTRandomWalk(mask = None, nu=5.0) Bases: :py:obj:`MVRandomWalk` Student-T random walk proposal. :param mask: proposal dimensions mask (default all space) :param float nu: Student-T nu parameter (default: 5)