for testing only: use self=TRUE with getParents in setupMargNodes - #1630
for testing only: use self=TRUE with getParents in setupMargNodes#1630paciorek wants to merge 6 commits into
self=TRUE with getParents in setupMargNodes#1630Conversation
…athway (issue 1625).
|
A test in |
|
@perrydv can you look at the change to the test in line 439 of test-setupMargNodes.R in this PR and see what you think about what the correct result is? If we use |
|
@paciorek I'm looking at this. It is admittedly a strange case in that providing only If
If I am following this correctly, in the test in question step 3(c) would apply, and then I am just puzzled about whether this was a mistake when the tests were written, or the interpretation of the confusing part of the documentation is correct, or what. The result of marginalizing with no data or given nodes at the end of a calculation would be trivial. Maybe that's why it was assumed the correct test result would not represent that. But on the other hand, the purpose of this case seems to be to follow the logic even if it is not a very smartly specified problem. |
|
@perrydv regarding your suggested revision to the help text, you say: "c. Elements of calcNodes (applies if calcNodes was provided but paramNodes is missing)" but in the code I see: which seems to indicate that the randomEffectsNodes need to be in both the calcNodes and in the parents of calcNodes (with self=FALSE), which would seem to be an impossibility except for those situations we've been discussing where the one input node is also the parent of another input node. Thoughts? |
|
@paciorek I see the confusion and don't have a good answer. I agree that in the old behavior this code would result in only calcNodes that are parents of other calcNodes. I am not sure if the text (which I tried to re-parse) was from reading this code or described the original intent and then the code deviated from that. It is more evidence that there is not really clear correct behavior to a default in this poorly specific case. Apparently the idea was that if only calcNodes are given, then the default for random effects nodes will be any latent nodes that are given in the calcNodes. That seems as simple and reasonable as we'll get. And if so then it appears the last |
We are seeing an inconsistency between nimbleModel and nimble in terms of
getParentsreturning some "self" items if they are parents of other input nodes.This checks if using
self=TRUEin withgetParentsinsetupMargNodeschanges any behavior.If not, that suggests we could use
self=TRUEinnimbleModel:::setupMargNodesto get consistent results with nimble.