-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Periodic parameters #98
Comments
@mreboud In the core of pypmc, we use Gaussians or STudent's T distributions for |
@dvandyk Ok, so you let your MCMC/PMC propose new points in a wider range and the indicator outputs the "corrected" proposed sample, correct? @pluegh Is this also what you had in mind? |
I have the impression that if you fit a Gaussian or Student's T mixture on an infinite support and wrap the result to your periodic parameter, you will have a descent description, no? Concerning the transformation layer, I am afraid that you will completely loose the gaussianity of you posterior distribution... |
@mreboud I have to correct what I said above. The topology from [0, 2pi] to Looks like it's not handled in BAT.jl currently. I checked how it's done in Stan. They have a put a lot of thought into these problems, so it's good to listen to them. On their forum, it's recommend to use the unit_circle, or when you also care about the amplitude, just stay in 2D and transform to angle/amplitude when needed That's also what Danny and I always used to to, prefer Cartesian coordinates. Perhaps if you just want a phase, add an artificial Gaussian-constrained parameter to augment to 2D Otherwise you get artifical multimodality because 0 and 2p seem like different values. using -100pi to +100pi will just add even more modes that are actually identical. In that case, you would have to start wrapping angles in the proposal for MCMC. I just don't know if extra care needs to be taken about covariances. Obviously one can't interpret them literally but only use them as a tool for generating new proposals. One needs to check if they proposal is still symmetric, I would assume so but it would need a closer look. Presumably one can do the same for the proposal in importance sampling, just have to make sure one correctly evaluates the probability of proposing a point given that one can come from different directions: say for a unit Gaussian, the probability to propose the state associated with pi is the sum to propose all values leading to the same state: -pi, 3pi, -3pi, +5pi, -5pi,... I don't think that's easy to compute for a multivariate Gaussian but it certainly can be approximated. |
@fredRos Thanks for your inputs. Our initial problem is that Cartesian coordinates are sometimes just not the good way to describe the posterior. In one project we have Gaussian constraints on the modulus and phase of a parameter and PMC just fails in describing the corresponding posterior with a Gaussian mixture. What Danny suggested is that the indicator function could output a corrected sample, where angles are shifted to the correct range. For MCMC this should be enough to implement periodicity properly. For the other algorithms, I can't say for the moment is this is enough to adjust everything. |
@mreboud There is nothing preventing you from applying a constraint in a transformed space and still let the sampler work on cartesian coordinates. But if you want to apply the constraints as prior constraints, then you would need to multiply with the Jacobian. And this would be more involved 👎 |
When a parameters is described with an angle (eg the argument of a complex number), MCMC and PMC have trouble describing the periodic boundaries of the parameter range.
I see two possible solutions:
[-100*pi, 100*pi]
, but it would be nice if pypmc couldwrap
the parameter space when estimating certain quantitiesThe text was updated successfully, but these errors were encountered: