Public Member Functions | |
| def | __init__ |
| def | random_state |
| def | random_state |
| def | acceptance_fraction |
| def | chain |
| def | flatchain |
| def | lnprobability |
| def | acor |
| def | get_lnprob |
| def | reset |
| def | clear_chain |
| def | sample |
| def | run_mcmc |
Public Attributes | |
| dim | |
| lnprobfn | |
| args | |
| iterations | |
| naccepted | |
An abstract sampler object that implements various helper functions
:param dim:
The number of dimensions in the parameter space.
:param lnpostfn:
A function that takes a vector in the parameter space as input and
returns the natural logarithm of the posterior probability for that
position.
:param args: (optional)
A list of extra arguments for ``lnpostfn``. ``lnpostfn`` will be
called with the sequence ``lnpostfn(p, *args)``.
Definition at line 22 of file sampler.py.
| def emcee.sampler.Sampler.acceptance_fraction | ( | self | ) |
The fraction of proposed steps that were accepted.
Definition at line 75 of file sampler.py.
| def emcee.sampler.Sampler.acor | ( | self | ) |
The autocorrelation time of each parameter in the chain (length: ``dim``) as estimated by the ``acor`` module.
Definition at line 108 of file sampler.py.
| def emcee.sampler.Sampler.chain | ( | self | ) |
A pointer to the Markov chain.
Definition at line 83 of file sampler.py.
| def emcee.sampler.Sampler.clear_chain | ( | self | ) |
An alias for :func:`reset` kept for backwards compatibility.
Definition at line 130 of file sampler.py.
| def emcee.sampler.Sampler.flatchain | ( | self | ) |
Alias of ``chain`` provided for compatibility.
Definition at line 91 of file sampler.py.
| def emcee.sampler.Sampler.get_lnprob | ( | self, | |
| p | |||
| ) |
Return the log-probability at the given position.
Definition at line 118 of file sampler.py.
| def emcee.sampler.Sampler.lnprobability | ( | self | ) |
A list of the log-probability values associated with each step in the chain.
Definition at line 99 of file sampler.py.
| def emcee.sampler.Sampler.random_state | ( | self | ) |
The state of the internal random number generator. In practice, it's the result of calling ``get_state()`` on a ``numpy.random.mtrand.RandomState`` object. You can try to set this property but be warned that if you do this and it fails, it will do so silently.
Definition at line 51 of file sampler.py.
| def emcee.sampler.Sampler.random_state | ( | self, | |
| state | |||
| ) |
Try to set the state of the random number generator but fail silently if it doesn't work. Don't say I didn't warn you...
Definition at line 63 of file sampler.py.
| def emcee.sampler.Sampler.reset | ( | self | ) |
Clear ``chain``, ``lnprobability`` and the bookkeeping parameters.
Definition at line 122 of file sampler.py.
| def emcee.sampler.Sampler.run_mcmc | ( | self, | |
| pos0, | |||
| N, | |||
rstate0 = None, |
|||
lnprob0 = None, |
|||
| kwargs | |||
| ) |
Iterate :func:`sample` for ``N`` iterations and return the result.
:param p0:
The initial position vector.
:param N:
The number of steps to run.
:param lnprob0: (optional)
The log posterior probability at position ``p0``. If ``lnprob``
is not provided, the initial value is calculated.
:param rstate0: (optional)
The state of the random number generator. See the
:func:`random_state` property for details.
:param kwargs: (optional)
Other parameters that are directly passed to :func:`sample`.
Definition at line 138 of file sampler.py.
1.8.5