Comments (4)
Thanks for the compliments! I'm glad that it's helpful!
I think that your intuition is correct about the fact that this is a significant problem. emcee
is definitely not very good at dealing with problems with identical maxima like that. I would just restrict the phases to [0, 2 * pi)
using you prior (just return -numpy.inf
from lnpost
if the parameter falls out of the range). This should work just fine in practice unless most of the mass is right around the break. In that case, it should still also work in theory but I expect that the convergence would be much less efficient.
Let me know if this helps or if you have any other questions.
from emcee.
Sure, that may be the most straightforward solution. But what about renormalizing the periodic variables after they're updated (say, at line 176 of ensemble.py), so that, for instance, a phase updated to 2 pi + 0.1 wraps over to 0.1?
from emcee.
If you have an amplitude A and a phase phi, the phase is periodic, but x = A cos phi and y = A sin phi is a coordinate transformation that is not periodic. It works in most cases of periodic signals. See our paper (Hou et al, with me and Goodman) for a transformation for exoplanet orbits that works very well. Similar things can be done for any periodic signal, I suspect.
from emcee.
"Sure, that may be the most straightforward solution. But what about renormalizing the periodic variables after they're updated (say, at line 176 of ensemble.py), so that, for instance, a phase updated to 2 pi + 0.1 wraps over to 0.1?"
This sounds better in my opinion, especially if there are lots of these periodic parameters in your model. Once you get into large dimensions with lots of hard edges in your prior, the rejection rate gets pretty high. The above strategy would give no rejections whatsoever for a flat likelihood.
from emcee.
Related Issues (20)
- Parallelization of emcee is working not as fast as expected HOT 4
- My samplers do not converge to maximum likelihood
- HDF backend file size
- Multiprocessing Pool scaling not as expected HOT 4
- [3.1.3] test failure with scipy 1.10 HOT 3
- Progress bar HOT 1
- Investigate the use of optree for structured parameter sets
- Issue on page /index.html HOT 1
- Add set_description to `pbar._NoOpPBar` HOT 1
- In emcee.EnsembleSampler threads command is not working
- Problem using 4-byte floats with EnsembleSampler HOT 4
- JAX implementation of emcee HOT 3
- issue with emcee installation HOT 3
- (solved) issue with sampler stalling with multiprocessing
- Saving non-arrayifiable data at each likelihood evaluation (either to disk or in memory) HOT 4
- Incompatible with numpy 2.0.0rc1 HOT 3
- New release to prepare for numpy 2 HOT 5
- Trying to use Blobs with the vectorize=True keyword returns a ValueError("incompatible input dimensions")
- emcee 3.1.5 incompatible with numpy < 1.25.0
- Using multithreading from tutorial doesnt seem to work
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emcee.