From feaa9ec6e60478cc403ccb30cf0944e61a63e1f6 Mon Sep 17 00:00:00 2001 From: Carlos Iguaran Date: Wed, 1 Nov 2023 16:20:09 -0300 Subject: [PATCH] Document how particles should be represented in SMC --- blackjax/smc/base.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/blackjax/smc/base.py b/blackjax/smc/base.py index 52d1338ef..d6bd81176 100644 --- a/blackjax/smc/base.py +++ b/blackjax/smc/base.py @@ -20,7 +20,21 @@ class SMCState(NamedTuple): - """State of the SMC sampler""" + """State of the SMC sampler + Particles must be a ArrayTree, each leave represents + a variable from the posterior, being an array of size (n_particles, the variable's dimensionality). + Examples (three particles): + - Single univariate posterior: + [ Array([[1.], [1.2], [3.4]]) ] + - Single bivariate posterior: + [Array([[1,2], [3,4], [5,6]])] + - Two variables, each univariate: + [ Array([[1.], [1.2], [3.4]]), + Array([[50.], [51], [55]]) ] + - Two variables, first one bivariate, second one 4-variate: + [ Array([[1., 2.], [1.2, 0.5], [3.4, 50]]), + Array([[50., 51., 52., 51], [51., 52., 52. ,54.], [55., 60, 60, 70]])] + """ particles: ArrayTree weights: Array