Questions tagged [emcee]

emcee is an affine-invariant Markov chain Monte Carlo (MCMC) ensemble sampler.

emcee is a Python implementation of the affine-invariant ensemble sampler for Markov chain Monte Carlo (mcmc) proposed by Goodman & Weare (2010).

The code is available online under the MIT License.

63 questions
11
votes
5 answers

Creating list of individual list items multiplied n times

I'm fairly new to Python, and think this should be a fairly common problem, but can't find a solution. I've already looked at this page and found it helpful for one item, but I'm struggling to extend the example to multiple items without using a…
user2444731
  • 113
  • 4
3
votes
1 answer

Why is tempered mcmc fit not convering well?

I am trying to fit a simple straight line y=mx+c type to some synthetic data using parallel-tempered mcmc. My goal is to just be able to understand how to use it, so that I can apply to some more complex models later. The example I am trying is the…
konstant
  • 685
  • 1
  • 7
  • 19
3
votes
1 answer

Python restarts shell in IDLE

I am using EMCEE Python package which is MCMC method. When I choose 500 steps and 300 walkers everything is OK and after couple of hours I have the results and outputs. But as I change them to higher steps (800) and higher walkers (400) after many…
Ma Y
  • 696
  • 8
  • 19
3
votes
1 answer

emcee walkers burn in but then remain the same

I'm having an issue using emcee. Its a simple enough 3 parameter fit but occasionally (only has occurred in two scenarios so far despite much use) my walkers burn in just fine but then do not move (see figure below). The acceptance fraction reported…
astrohuman
  • 45
  • 7
3
votes
2 answers

Using emcee with Gaussian Priors

I'm trying to use a gaussian prior using emcee and can't seem to fully figure it out. Basically I want to replace def lnprior(theta): a, b, c = theta if 1.0 < a < 2.0 and 1.0 < b < 2.0 and 1.0 < c < 2.0: return 0.0 return…
spnlola
  • 31
  • 1
  • 2
2
votes
1 answer

How do I place restrictions on the values that the Emcee sampler can choose?

I am trying to use the emcee python package to draw samples from a distribution and maximize the likelihood that my data came from the sampled parameters. So for example, I have a parameter N and I trying to find a value for N that maximizes the…
user1551817
  • 6,693
  • 22
  • 72
  • 109
2
votes
0 answers

Speed-up eigenvalue problem in MCMC or HMC

Brief background: I am using Bayesian inference methods like MCMC or HMC. As of now I had been using emcee package to infer model parameters using MCMC. The primary reason why I was using emcee was because it allows MPI to parallelize the walkers…
sbdas
  • 21
  • 2
2
votes
1 answer

Identical steps while running emcee in parallel with Pool

I am running an MCMC process in Python using emcee. My python code is a wrapper around a different software. emcee walkers sample the input parameter space to this software. The software reads a text file as its input. My code generates this text…
V.I.Raj
  • 21
  • 1
2
votes
1 answer

Hide sample points in corner plot using corner.corner

In the context of Markov Chain Monte Carlo, I want to plot the 2D posterior distribution for a parameter estimation problem using corner.corner. The figure that I have now looks like this: In the contour plot, the contours are defined by…
Bremsstrahlung
  • 686
  • 1
  • 9
  • 23
2
votes
1 answer

Passing input of a function returning NaN in Python

I am using EMCEE. I write a part which problem is risen from there in the following. I ran into this error ValueError: lnprob returned NaN. this error interrupts the calculation and I do not know how to overcome. So, I should do something to pass…
Ma Y
  • 696
  • 8
  • 19
2
votes
1 answer

Define a custom prior for each parameter in emcee

I have a function with three parameters a,b and c and I want to define different priors for each of these parameters. I am using the emcee package. I started with the simple uniform (non-informative) prior: def lnprior(theta): m, b, c = theta …
2
votes
1 answer

Total size of array must be unchanged

I am using a Python module called emcee to sample a distribution. I need to pass a (37,100) (which I have named Ntrig and Nsamp, respectively) array called events to the below function. def mp(SNR2, *events): events =…
naomig
  • 271
  • 1
  • 7
  • 12
2
votes
1 answer

Walkers not "walking" in model fit using MCMC

I am having difficulty in performing an MCMC analysis of a model. I believe it relates to the fact I have an incomplete gamma function within the model. I trying to minimise a Gaussian log-likelihood but it appears the walkers are stuck in their…
Ajihood
  • 123
  • 1
  • 8
1
vote
0 answers

emcee generates the same samples twice

I'm using emcee to generate samples with a given ln_prob twice, but both times yield the exact same samples. I am using the same initial state for both samplers, but I don't see why it should matter. Am I wrong thinking that it should yield…
Glance
  • 11
  • 2
1
vote
1 answer

Is there a way to parallelize a function inside a pool in Python?

I am trying to parallelize a function inside a pool using the multiprocessing module, but I run into the error: daemonic processes are not allowed to have children More specifically, I am using emcee module which makes use of the multiprocessing…
1
2 3 4 5