This nimbleFunction generator must be specialized to three required arguments: a model, a modelValues, and a character vector of node names.
decideAndJump(model, mvSaved, target, UNUSED)
An uncompiled or compiled NIMBLE model object.
A modelValues object containing identical variables and logProb variables as the model. Can be created by modelValues(model)
.
A character vector providing the target node.
Unused placeholder argument.
Daniel Turek
Calling decideAndJump(model, mvSaved, target) will generate a specialized nimbleFunction with four required numeric arguments:
modelLP1: The model log-probability associated with the newly proposed value(s)
modelLP0: The model log-probability associated with the original value(s)
propLP1: The log-probability associated with the proposal forward-transition
propLP0: The log-probability associated with the proposal reverse-tranisiton
Executing this function has the following effects: -- Calculate the (log) Metropolis-Hastings ratio, as logMHR = modelLP1 - modelLP0 - propLP1 + propLP0 -- Make the proposal acceptance decision based upon the (log) Metropolis-Hastings ratio -- If the proposal is accepted, the values and associated logProbs of all calcNodes are copied from the model object into the mvSaved object -- If the proposal is rejected, the values and associated logProbs of all calcNodes are copied from the mvSaved object into the model object -- Return a logical value, indicating whether the proposal was accepted