particles.binary_smc¶
SMC samplers for binary spaces.
Overview¶
This module implements SMC tempering samplers for target distributions defined with respect to a binary space, {0, 1}^d. This is based on Schäfer & Chopin (2014). Note however the version here also implements the waste-free version of these SMC samplers, see Dang & Chopin (2020).
This module builds on the smc_samplers
module. The general idea is that the N
particles are represented by a (N, d) boolean numpy array, and the different
components of the SMC sampler (e.g. the MCMC steps) operate on such arrays.
More precisely, this module implements:
NestedLogistic
: the proposal distribution used in Schäfer and Chopin (2014), which amounts to fit a logistic regression to each component i, based on the (i-1) previous components. This is a sub-class ofdistributions.DiscreteDist
.BinaryMetropolis
: Independent Metropolis step based on a NestedLogistic proposal. This is a sub-class ofsmc_samplers.ArrayMetropolis
.Various sub-classes of
smc_samplers.StaticModel
that implements Bayesian variable selection.
See also the scripts in papers/binarySMC for numerical experiments.
References
Dau, H. D., & Chopin, N. (2022). Waste-free sequential Monte Carlo. Journal of the Royal Statistical Society Series B: Statistical Methodology, 84(1), 114-148.
Schäfer, C., & Chopin, N. (2013). Sequential Monte Carlo on large binary sampling spaces. Statistics and Computing, 23, 163-184.
Functions
|
|
|
|
|
|
|
|
|
log without the warning about x <= 0. |
Classes
|
Likelihood is exp{ - lambda * BIC(gamma)} |
|
Marginal likelihood for the following hierarchical model: Y = X beta + noise noise ~ N(0, sigma^2) sigma^2 ~ IG(nu / 2, lambda*nu / 2) beta | sigma^2 ~ N(0, v2 sigma^2 I_p) |
|
Same model as parent class, except: beta | sigma^2 ~ N(0, g sigma^2 (X'X)^-1) |
|
|
|
|
|
Nested logistic proposal distribution. |
|
Meta-class for variable selection. |