1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
"""
Demo of the proposed "blobs" feature.
"""
# Adding the development version of `emcee` to the path so that this works
# even if you have an older (stable) version of the module installed on your
# path. NOTE: This should be removed once we merge this feature.
= +
# This is a dumb-ass log-probability function that also returns a random
# "blob" (this can be any arbitrary---preferably picklable---Python object
# that is associated with this particular position in parameter space.
return -0.5 * ,
# Set up the sampler and randomly select a starting position.
, = 100, 50
=
=
# Sample for a few iterations.
= 500
print
# The blobs are stored in the `blobs` object. This object is a list (of
# length `niterations`) of lists (of length `nwalkers`).
print