Description Usage Arguments Details Value Examples
acceptProposal
is a utility function to determine if a proposal should
be accepted in a Metropolis or Metropolis-Hastings step. This is shamelessly
stolen from AcceptProposal in the overture
package.
1 | acceptProposal(logCurr, logProp, logCurrToProp = 0, logPropToCurr = 0)
|
logCurr |
log density of the target at the current value, log(P(x)) |
logProp |
log density of the target at the proposed value, log(P(x')) |
logCurrToProp |
log of transition distribution from current value to proposed value, log(g(x'|x)) |
logPropToCurr |
log of transition distribution from proposed value to current value, log(g(x|x')) |
The function uses the Metropolis choice for a Metropolis/Metropolis-Hastings sampler, which accepts a proposed value x' with probability
A(x', x) = min(1, P(x')/P(x) g(x|x')/g(x'|x))
where P(x) is the target distribution and g(x'|x) is the proposal distribution.
TRUE/FALSE
for whether the proposal should be accepted or
rejected, respectively
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.