Implementing periodic or reflective boundary conditions in emcee

49 views
Skip to first unread message

A.N.

unread,
Oct 28, 2022, 3:59:33 AM10/28/22
to emcee users
Hi all,

Is it possible to implement periodic or reflective boundary conditions in emcee?

I understand that where the likelihood is more or less completely uniform in a parameter that there can be pile-up at the edges of the prior bounds; and this may be reduced by setting periodic or reflective boundary conditions. Is this true and if so, is there a straightforward way to implement this in emcee?

Thanks.

Radek Poleski

unread,
Oct 28, 2022, 4:51:29 AM10/28/22
to A.N., emcee users
Hi,

I talked with Dan about it some time ago. You just need to use 2 variables (x, y) instead of one (e.g., p that changes from p_min to p_max). Both x and y change from -1 to 1 and p is calculated via:

p = p_min + (p_max - p_min) * (np.arctan2(x, y) + np.pi) / (2. * np.pi)

HTH

Radek



--
You received this message because you are subscribed to the Google Groups "emcee users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to emcee-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/emcee-users/1e0606b5-fba7-4aa1-a4f2-aa319a0ff547n%40googlegroups.com.

David W Hogg

unread,
Oct 28, 2022, 7:04:13 PM10/28/22
to Radek Poleski, A.N., emcee users
The key idea is that the stretch move assumes that the parameter space is a vector space that obeys vector addition and subtraction. Reflection and rings don’t generally obey vector addition.

--
David W. Hogg — http://cosmo.nyu.edu/hogg/
Reply all
Reply to author
Forward
0 new messages