Closed TTitscher closed 2 years ago
Hint: Changing only this term in our F equation causes almost all tests to fail.
I think we had a long discussion on this difference and at that time agreed that the derivation in the paper was wrong.
For sure! But is ours correct...? In anyway, we should simplify the F formula and may have a look into the correctness of the ARD.
Apart from checking and double-checking the formulas, is there a way to test the free energy?
We already have an analytical test case, so we know that the KL divergence from true posterior to our approximated posterior is zero (right??). That means that evidence = free energy, right? @aradermacher ? :smile:
Yes, I would guess, that this should be correct as long as the KL divergence is really zero. Can we check that?
Update on the original question:
The terms only cancel out, if we actually perform the noise update. This may also relate to this comment of @joergfunger who suggests the double check or adapt the free energy formula for the case of a skipped noise update.
But IMO the case of no noise update quite nicely covered by having a super narrow gamma prior
g = vb.Gamma.FromMeanStd(1/fixed_sd**2, 1.e-8)
In Chappell's paper, F contains the terms:
F = ... + (N/2 + c0 -1)stuff + ... - (N/2 + c -1)stuff
Our F formula contains the terms
F = ... + (N/2 + c0 -1)stuff + ... - (c -1)stuff
which, using the update equation
c = N/2 + c0
, would expand toF = ... + (N/2 + c0 -1)stuff + ... - (N/2 + c0 -1)stuff
and cancel out. Which one is correct?! :worried: