Recovering symmetric parameters from sum of sine waves

Right, you’re seeing multimodality because each sine wave could be the other one. And you’re right that the way to address it is doing something like imposing an ordering via priors. Take a look at the ordered transform, or you could define your priors on say the frequency something like:

freq1 = pm.SomePositiveDistribution("freq1", ...)
delta_freq = pm.SomePositiveDistribution("delta_freq", ...)
freq2 = pm.Deterministic("freq2", freq1 + delta_freq)

to get the same effect. Another way to do it would be with pm.Potential.

1 Like