Skip to content

Commit

Permalink
Document how particles should be represented in SMC
Browse files Browse the repository at this point in the history
  • Loading branch information
ciguaran committed Nov 1, 2023
1 parent f5a2a12 commit feaa9ec
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion blackjax/smc/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit feaa9ec

Please sign in to comment.