Coder Social home page Coder Social logo

Periodic model parameters? about emcee HOT 4 CLOSED

dfm avatar dfm commented on May 27, 2024
Periodic model parameters?

from emcee.

Comments (4)

dfm avatar dfm commented on May 27, 2024

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.

vallis avatar vallis commented on May 27, 2024

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.

davidwhogg avatar davidwhogg commented on May 27, 2024

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.

eggplantbren avatar eggplantbren commented on May 27, 2024

"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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.