EmceeSampler
- class ssapy.rvsampler.EmceeSampler(probfn, initializer, nWalker=50)[source][source]
Bases:
object
A sampler built on the emcee package.
The emcee packages implements the Goodman and Weare (2010) affine-invariant sampler. This is often an efficient sampler to use when selecting a proposal distribution is not simple.
- Parameters:
probfn (Callable) – Callable that accepts sampling parameters p and returns posterior probability.
initializer (Callable) – Callable that accepts number of desired initial samples and returns samples. Note, the initial samples should be (at least mostly) unique.
nWalker (int) – Number of ‘walkers’ to use in the Goodman & Weare algorithm. This should generally be at least 12 for the 6-dimensional problem.
- sample(nBurn, nStep)[source][source]
Generate samples, first discarding nBurn steps, and then keeping nStep steps.
Methods Summary
sample
([nBurn, nStep])Generate samples.
Methods Documentation
- sample(nBurn=1000, nStep=500)[source][source]
Generate samples.
- Parameters:
- Returns:
chain (array (nStep, nWalker, 6)) – Generated samples. Columns are [x, y, z, vx, vy, vz].
lnprob (array (nStep, nWalker)) – The log posterior probabilities of the samples.
lnprior (array(nStep, nWalker)) – The log prior values for each step.