madsjulia / AffineInvariantMCMC.jl

Affine Invariant Markov Chain Monte Carlo (MCMC) Ensemble sampler
http://mads.gitlab.io
Other
32 stars 9 forks source link

Pass parameters to llhood function? #9

Open BanjoCam opened 2 years ago

BanjoCam commented 2 years ago

Good day,

Thank you so much for making this library.

I am relatively new to Julia in general and trying to port over an MCMC tool I wrote in python with emcee. I have successfully gotten it working with your library (and it's loads faster - which was my purpose for porting, so quite happy!)

I need to pass additional arguments to my llhood function outside of the vector with the parameters. (I have a bunch of details that are required to run the function, that do not change during sampling.) In emcee this is trivial (you can pass an args argument, ie:

sampler = emcee.EnsembleSampler(nwalkers, ndim, logpost, args=[case]) 

) but I do not see how to do that in this library. (For testing, I just hard coded the details in the function...)

I tried modifying the sample function to pass more to the rpmap call, I made a bit of progress but it was too complicated for me.

Is there an obvious way I'm missing here? Or any other suggestions?

Thank you!