Creating a MCMC sampler based on the emcee python import

Hello everyone,

I am currently working on pystan 3.7, and I am trying to create a Monte Carlo model function in Stan that imitates or does the same thing as the python import emcee function, EnsembleSampler ( and Sample). I have added it here for convenience: The Ensemble Sampler — emcee . I am quite new to Stan so it is taking a while for me to actually understand what I am meant to do. I am reaching out to see if anyone knows if there is a pre built model that can already do the mcmc sampling from emcee or perhaps someone has made a similar model that I can reference?

I would also appreciate any guiding points to get me started on the coding.

Let me know if any additional information is needed.

Thank you in advance for any replies, anything is appreciated!

unfortunately, it is not very clear to me what exactly are you trying to achieve - are you trying to build a new MCMC algorithm that would work with Stan models (in which case you probably want to work with GitHub - roualdes/bridgestan: BridgeStan provides efficient in-memory access through Python, Julia, and R to the methods of a Stan model.)? Or are you trying a Stan model that runs MCMC within the model (this is not really possible, happy to explain why)? Or is it something else?


Apologies for being unclear, I have been working on a model that uses mcmc. I have since figured out how to deal with it (I think), and have been working on probability functions ever since.

Thank you for the reply though!

1 Like

Hi, I am interested in the progress you made. I have a working emcee MCMC that is finding minimum of the chi2 function. I tried to perform similar thing with the pymc3 but failed, and now looking for the stan. Would you care to share your progress?