Omit unneeded marginalization nodes and rework messaging for setupMargNodes warnings#1582
Conversation
for setupMargNodes warnings.
|
@paciorek this looks good to me. Just a few minor comments. This is purely coding style, but I don't use |
|
Thanks for the suggestions - I'm following them for the most part. I would ideally like to use the term "marginalization", but MCEM makes it more complicated - it's not exactly marginalization, but the averaging over the unknowns is similar to marginalization (and our MCEM is not much used) so maybe it's ok to use that term. But I am leaving this for another day and omitting "marginalization" from the message. And of course, it is a bit discordant that MCEM uses a function named |
Per nimbleQuad issue 56, this (by default but overrideable by a nimble opton) omits extraneous latent nodes that a user might have included in
randomEffectsNodesorlatentNodesthat are passed intosetupMargNodes. If this is not done, Laplace inner optimization can fail if a latent node in its own isolated Laplace approximation has no data dependents.I've added a simple test. It would be helpful if @perrydv takes a look at this, in particular the test to see if this is the behavior we want and if there are more complicated situations we should test.