emcee.readthedocs.io Open in urlscan Pro
2606:4700::6811:2152  Public Scan

Submitted URL: http://emcee.readthedocs.io/
Effective URL: https://emcee.readthedocs.io/en/stable/
Submission: On December 14 via api from US — Scanned from DE

Form analysis 2 forms found in the DOM

GET search/

<form class="bd-search d-flex align-items-center" action="search/" method="get">
  <i class="icon fas fa-search"></i>
  <input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off">
</form>

GET //readthedocs.org/projects/emcee/search/

<form id="flyout-search-form" class="wy-form" target="_blank" action="//readthedocs.org/projects/emcee/search/" method="get">
  <input type="text" name="q" aria-label="Dokumente durchsuchen" placeholder="Dokumente durchsuchen">
</form>

Text Content

Toggle navigation sidebar
Toggle in-page Table of Contents





EMCEE



User Guide

 * Installation
 * The Ensemble Sampler
 * Moves
 * Blobs
 * Backends
 * Autocorrelation Analysis
 * Upgrading From Pre-3.0 Versions
 * FAQ

Tutorials

 * Quickstart
 * Fitting a model to data
 * Parallelization
 * Autocorrelation analysis & convergence
 * Saving & monitoring progress
 * Using different moves

Theme by the Executable Book Project
  v: stable
Versionen latest stable v3.1.4 v3.1.3 v3.1.2 v3.1.1 v3.1.0 v3.0.2 v3.0.1 v3.0.0
v2.2.1 develop Auf Read the Docs Projektstartseite Erstellungsprozesse Downloads
Auf GitHub Ansehen Suche


--------------------------------------------------------------------------------

Bereitgestellt von Read the Docs · Datenschutz-Bestimmungen

 * repository
 * open issue
 * suggest edit

 * .rst
 * .pdf

Contents
 * Basic Usage
 * How to Use This Guide
 * License & Attribution
 * Changelog
   * 3.1.2 (2022-05-10)
   * 3.1.1 (2021-08-23)
   * 3.1.0 (2021-06-25)
   * 3.0.2 (2019-11-15)
   * 3.0.1 (2019-10-28)
   * 3.0.0 (2019-09-30)
   * 2.2.0 (2016-07-12)
   * 2.1.0 (2014-05-22)
   * 2.0.0 (2013-11-17)
   * 1.2.0 (2013-01-30)
   * 1.1.3 (2012-11-22)
   * 1.1.2 (2012-08-06)
   * 1.1.1 (2012-07-30)
   * 1.1.0 (2012-07-28)
   * 1.0.1 (2012-03-31)
   * 1.0.0 (2012-02-15)


EMCEE


CONTENTS

 * Basic Usage
 * How to Use This Guide
 * License & Attribution
 * Changelog
   * 3.1.2 (2022-05-10)
   * 3.1.1 (2021-08-23)
   * 3.1.0 (2021-06-25)
   * 3.0.2 (2019-11-15)
   * 3.0.1 (2019-10-28)
   * 3.0.0 (2019-09-30)
   * 2.2.0 (2016-07-12)
   * 2.1.0 (2014-05-22)
   * 2.0.0 (2013-11-17)
   * 1.2.0 (2013-01-30)
   * 1.1.3 (2012-11-22)
   * 1.1.2 (2012-08-06)
   * 1.1.1 (2012-07-30)
   * 1.1.0 (2012-07-28)
   * 1.0.1 (2012-03-31)
   * 1.0.0 (2012-02-15)


EMCEE#

emcee is an MIT licensed pure-Python implementation of Goodman & Weare’s Affine
Invariant Markov chain Monte Carlo (MCMC) Ensemble sampler and these pages will
show you how to use it.

This documentation won’t teach you too much about MCMC but there are a lot of
resources available for that (try this one). We also published a paper
explaining the emcee algorithm and implementation in detail.

emcee has been used in quite a few projects in the astrophysical literature and
it is being actively developed on GitHub.


BASIC USAGE#

If you wanted to draw samples from a 5 dimensional Gaussian, you would do
something like:

import numpy as np
import emcee

def log_prob(x, ivar):
    return -0.5 * np.sum(ivar * x ** 2)

ndim, nwalkers = 5, 100
ivar = 1. / np.random.rand(ndim)
p0 = np.random.randn(nwalkers, ndim)

sampler = emcee.EnsembleSampler(nwalkers, ndim, log_prob, args=[ivar])
sampler.run_mcmc(p0, 10000)


A more complete example is available in the Quickstart tutorial.


HOW TO USE THIS GUIDE#

To start, you’re probably going to need to follow the Installation guide to get
emcee installed on your computer. After you finish that, you can probably learn
most of what you need from the tutorials listed below (you might want to start
with Quickstart and go from there). If you need more details about specific
functionality, the User Guide below should have what you need.

We welcome bug reports, patches, feature requests, and other comments via the
GitHub issue tracker, but you should check out the contribution guidelines
first. If you have a question about the use of emcee, please post it to the
users list instead of the issue tracker.

User Guide

 * Installation
   * Package managers
   * Distribution packages
   * From source
   * Test the installation
 * The Ensemble Sampler
 * Moves
   * Ensemble moves
   * Metropolis–Hastings moves
 * Blobs
   * Using blobs to track the value of the prior
   * Named blobs & custom dtypes
 * Backends
 * Autocorrelation Analysis
 * Upgrading From Pre-3.0 Versions
 * FAQ
   * What are “walkers”?
   * How should I initialize the walkers?
   * Parameter limits

Tutorials

 * Quickstart
 * Fitting a model to data
 * Parallelization
 * Autocorrelation analysis & convergence
 * Saving & monitoring progress
 * Using different moves


LICENSE & ATTRIBUTION#

Copyright 2010-2021 Dan Foreman-Mackey and contributors.

emcee is free software made available under the MIT License. For details see the
LICENSE.

If you make use of emcee in your work, please cite our paper (arXiv, ADS,
BibTeX).


CHANGELOG#


3.1.2 (2022-05-10)#

 * Removed numpy from setup_requires #427

 * Made the sampler state indexable #425


3.1.1 (2021-08-23)#

 * Added support for a progress bar description #401


3.1.0 (2021-06-25)#

 * Added preliminary support for named parameters #386

 * Improved handling of blob dtypes #363

 * Fixed various small bugs and documentation issues


3.0.2 (2019-11-15)#

 * Added tutorial for moves interface

 * Added information about contributions to documentation

 * Improved documentation for installation and testing

 * Fixed dtype issues and instability in linear dependence test

 * Final release for JOSS submission


3.0.1 (2019-10-28)#

 * Added support for long double dtypes

 * Prepared manuscript to submit to JOSS

 * Improved packaging and release infrastructure

 * Fixed bug in initial linear dependence test


3.0.0 (2019-09-30)#

 * Added progress bars using tqdm.

 * Added HDF5 backend using h5py.

 * Added new Move interface for more flexible specification of proposals.

 * Improved autocorrelation time estimation algorithm.

 * Switched documentation to using Jupyter notebooks for tutorials.

 * More details can be found on the docs.


2.2.0 (2016-07-12)#

 * Improved autocorrelation time computation.

 * Numpy compatibility issues.

 * Fixed deprecated integer division behavior in PTSampler.


2.1.0 (2014-05-22)#

 * Removing dependence on acor extension.

 * Added arguments to PTSampler function.

 * Added automatic load-balancing for MPI runs.

 * Added custom load-balancing for MPI and multiprocessing.

 * New default multiprocessing pool that supports ^C.


2.0.0 (2013-11-17)#

 * Re-licensed under the MIT license!

 * Clearer less verbose documentation.

 * Added checks for parameters becoming infinite or NaN.

 * Added checks for log-probability becoming NaN.

 * Improved parallelization and various other tweaks in PTSampler.


1.2.0 (2013-01-30)#

 * Added a parallel tempering sampler PTSampler.

 * Added instructions and utilities for using emcee with MPI.

 * Added flatlnprobability property to the EnsembleSampler object to be
   consistent with the flatchain property.

 * Updated document for publication in PASP.

 * Various bug fixes.


1.1.3 (2012-11-22)#

 * Made the packaging system more robust even when numpy is not installed.


1.1.2 (2012-08-06)#

 * Another bug fix related to metadata blobs: the shape of the final blobs
   object was incorrect and all of the entries would generally be identical
   because we needed to copy the list that was appended at each step. Thanks
   goes to Jacqueline Chen (MIT) for catching this problem.


1.1.1 (2012-07-30)#

 * Fixed bug related to metadata blobs. The sample function was yielding the
   blobs object even when it wasn’t expected.


1.1.0 (2012-07-28)#

 * Allow the lnprobfn to return arbitrary “blobs” of data as well as the
   log-probability.

 * Python 3 compatible (thanks Alex Conley)!

 * Various speed ups and clean ups in the core code base.

 * New documentation with better examples and more discussion.


1.0.1 (2012-03-31)#

 * Fixed transpose bug in the usage of acor in EnsembleSampler.


1.0.0 (2012-02-15)#

 * Initial release.

next

Installation

© Copyright 2012-2021, Dan Foreman-Mackey & contributors.