A Hastings sampler for a probability distribution π(s) is an MCMC algorithm that makes use of a proposal distribution Q(s ′ |s) from which it draws samples, and uses an acceptance/rejection scheme to define a transition kernel with the desired distribution π(s).
given the current state s, a sample s ′ = s drawn from Q(s ′ |s) is accepted as the next state with probability and with probability 1 − A(s, s ′ ) the proposal is rejected and the next state is the current state s. We use a component-wise proposal distribution, generating new proposed values for t i , where i is chosen at random.