Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

decide

Makes the Metropolis-Hastings acceptance decision, based upon the input (log) Metropolis-Hastings ratio


Description

This function returns a logical TRUE/FALSE value, indicating whether the proposed transition should be accepted (TRUE) or rejected (FALSE).

Usage

decide(logMetropolisRatio)

Arguments

logMetropolisRatio

The log of the Metropolis-Hastings ratio, which is calculated from model probabilities and forward/reverse transition probabilities. Calculated as the ratio of the model probability under the proposal to that under the current values multiplied by the ratio of the reverse transition probability to the forward transition probability.

Details

The Metropolis-Hastings accept/reject decisions is made as follows. If logMetropolisRatio is greater than 0, accept (return TRUE). Otherwise draw a uniform random number between 0 and 1 and accept if it is less that exp(logMetropolisRatio. The proposed transition will be rejected (return FALSE). If logMetropolisRatio is NA, NaN, or -Inf, a reject (FALSE) decision will be returned.

Author(s)

Daniel Turek


nimble

MCMC, Particle Filtering, and Programmable Hierarchical Modeling

v0.11.0
BSD_3_clause + file LICENSE | GPL (>= 2)
Authors
Perry de Valpine [aut], Christopher Paciorek [aut, cre], Daniel Turek [aut], Nick Michaud [aut], Cliff Anderson-Bergman [aut], Fritz Obermeyer [aut], Claudia Wehrhahn Cortes [aut] (Bayesian nonparametrics system), Abel Rodrìguez [aut] (Bayesian nonparametrics system), Duncan Temple Lang [aut] (packaging configuration), Sally Paganin [aut] (reversible jump MCMC), Jagadish Babu [ctb] (code for the compilation system for an early version of NIMBLE), Lauren Ponisio [ctb] (contributions to the cross-validation code), Peter Sujan [ctb] (multivariate t distribution code)
Initial release
2021-04-16

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.