MH_accept: Calculate the acceptance probability of a Metropolis-Hastings...

Description Usage Arguments Value Examples

View source: R/MH_accept.R

Description

This function calculates alpha, the acceptance probability of a MH step, for a random walk or similar where the proposal is symmetric so cancels and one is left with a ratio of likelihoods.

Usage

1
MH_accept(llh, llh.prime)

Arguments

llh

The value of the log-likelihood with the current value of the paramter in question.

llh.prime

The value of the log-likelihood with the newly drawn value of the paramter in question.

Value

Returns the min(1, ratio of likelihoods).

Examples

1
MH_accept(llh, llh.prime)

BenjamenSimon/EpidemicR documentation built on March 23, 2020, 11:03 p.m.