Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how particles should be represented in SMC #582

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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, ...)`.
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