nimble-dev / nimble

The base NIMBLE package for R
http://R-nimble.org
BSD 3-Clause "New" or "Revised" License
153 stars 22 forks source link

error trap multivariate samplers assigned to target nodes of RJMCMC #1471

Open paciorek opened 6 days ago

paciorek commented 6 days ago

As discussed with a user, it doesn't make sense to have a mv sampler assigned to a node that is being configured for RJMCMC. That sampler will be toggled off and wouldn't sample the other parameters that it is supposed to sample. And we don't have a way to have the mv sampler operate in the reduced dimension space when the target node is not in the model anyway.

So we need to add an error trap that having mv sampler on a target node is not allowed.

While we are thinking about this, we should also consider what happens if the target node has two samplers (either two univariate or one univar and one mv) assigned to it. I don't know that we would handle this correctly - presumably we want to toggle off both samplers. I haven't checked what would actually happen.

danielturek commented 5 days ago

Agreed that these cases need some attention. My initial thought would be to error-trap any of these non-standard cases: when anything other than a single, univariate sampler, is operating on a node specified for RJMCMC.

I'd be happy to take care of this a bit later in the summer, unless anyone else gets to it first.