Skip to content

Correct glitch amplitude prior denominator

draw_glitch_amplitude samples an amplitude from a wavelet's glitch amplitude prior. To do so, the function computes a probability density multiple times. In some instances, it multiplies the density's denominator by an extra factor of 2. Those instances are here:

line 69: https://git.ligo.org/lscsoft/bayeswave/-/blob/0dadee601d4fd2468f0342ff7f4c995598374858/src/BayesWaveProposal.c#L69

line 95: https://git.ligo.org/lscsoft/bayeswave/-/blob/0dadee601d4fd2468f0342ff7f4c995598374858/src/BayesWaveProposal.c#L95

Meanwhile the prior is correctly computed without the factor of 2 here:

line 82: https://git.ligo.org/lscsoft/bayeswave/-/blob/0dadee601d4fd2468f0342ff7f4c995598374858/src/BayesWaveProposal.c#L82

This issue seems to have arisen because the variable SNRsq has a factor of 2 inside of it. The incorrect prior calculations assume that SNRsq does not contain that factor of 2. Notice that in the similar draw_signal_amplitude function, SNRsq has a factor of 4, and none of the SNR computations contain an extra 4 in their denominators:

https://git.ligo.org/lscsoft/bayeswave/-/blob/0dadee601d4fd2468f0342ff7f4c995598374858/src/BayesWaveProposal.c#L121

This merge request removes the extra factors of 2 from lines 69 and 95.

Merge request reports