Skip to content

Candidate fix to #1564 (but in getConditionallyIndependentSets)#1576

Merged
paciorek merged 2 commits into
develfrom
fix-1564
Jul 30, 2025
Merged

Candidate fix to #1564 (but in getConditionallyIndependentSets)#1576
paciorek merged 2 commits into
develfrom
fix-1564

Conversation

@perrydv
Copy link
Copy Markdown
Contributor

@perrydv perrydv commented Jul 22, 2025

I am throwing this up as a candidate fix. It fixes Issue #1564 and it passes test-setupMargNodes.R.

We should probably tests in (at least) nimbleQuad (in development at this time) and nimbleSMC,

If this seems to work, I will document more about the change and add a regression test.

The basic idea is: don't mark deteministic nodes as touched during getConditionallyIndependent sets traversals of the graph. The reason is that as we are iterating over a set of parent (or presumably in some cases child) nodes, the recursions could pass through a deterministic node that then needs to be passed through by a later parent (or child) node of the original iterations. But if it has been "touched" (tagged as done), then it blocks activity. But in the case of a deterministic node, this is not really correct. So it takes a particular setup of nodes to trigger the issue. I think it is actually correct to never tag deterministic nodes, since the algorithm is fundamentally about stochastic nodes.

@paciorek
Copy link
Copy Markdown
Contributor

paciorek commented Jul 26, 2025

For discussion - it's not clear to me why tests would go into nimbleQuad given this is really about cond. indep. sets.

I've added a (the?) regression test for the example in #1564.

I'll note that setupMargNodes is mostly about Laplace-related stuff but is used in MCEM too. So my plan was to keep it in nimble and not move to nimbleQuad.

@paciorek
Copy link
Copy Markdown
Contributor

This passed testing previously; I just canceled the tests to avoid a bunch of test computation when adding the simple regression test.

@paciorek
Copy link
Copy Markdown
Contributor

This passes the (limited new) tests in nimbleQuad and the nimbleSMC tests. I'm going to merge in.

(Actually a test-quadrature.R test is failing, but that was apparently failing before.)

@paciorek paciorek merged commit 6d46400 into devel Jul 30, 2025
0 of 8 checks passed
@paciorek paciorek deleted the fix-1564 branch July 30, 2025 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants