RandomWalkProposal¶
- class telescopic.kernels.RandomWalkProposal(factor, inverse)¶
The Gaussian random-walk proposal \(x' = x + Bz\), \(z \sim \mathcal N(0, I)\).
Its density is symmetric, so the log acceptance ratio is \(\log\pi(x') - \log\pi(x)\).
- Parameters:
- factorarray_like, shape (d, d)
\(B\), a factor of the proposal covariance \(BB^\top\), such as its Cholesky factor.
- inversearray_like, shape (d, d)
\(B^{-1}\), checked against
factorto within rounding; a matrix that is not its inverse raisesValueError.
- log_alpha(target, current, proposed, forward)¶
The log acceptance ratios \(\log\pi(x') - \log\pi(x) + \log q(x \mid x') - \log q(x' \mid x)\).
- sample(target, state, draws)¶
Draw a proposal \(x' \sim q(\cdot \mid x)\) for each chain.
- Parameters:
- Returns:
- x
ndarray, shape (n, d) The proposals.
- forward
What
log_alpha()needs of the draw, orNone.
- x