accept_rate: Compute Acceptance Rates for Metropolis-Hastings and...

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/accept_rate.R

Description

This function computes the acceptance rates of the Metropolis-Hastings and reversible jump algorithms from the MCMC output of bcct and bict objects.

Usage

1
accept_rate(object)

Arguments

object

An object of class "bcct" or "bict".

Details

Acceptance rates can be used to assess the performance of MCMC methods (in particular the peformance of the reversible jump method, Brooks et al, 2003).

Value

This function will return an object of class "acceptrate" which is a list with the following components.

rj_ar

Acceptance rate (as a %) of the reversible jump algorithm.

mh_ar

Acceptance rate (as a %) of the Metropolis-Hastings algorithm.

Author(s)

Antony M. Overstall A.M.Overstall@soton.ac.uk.

References

Brooks, S.P., Giudici, P., & Roberts, G.O. (2003) Efficient construction of reversible jump Markov chain Monte Carlo proposal distributions. Journal of the Royal Statistical Society, Series B, 65 (1), 3–55.

See Also

print.acceptrate, bcct, bict.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
set.seed(1) ## set a seed for reproducibility
data(AOH)
test1<-bcct(formula=y~(alc+hyp+obe)^3,data=AOH,n.sample=500,prior="UIP")
## Create a bcct object for the AOH dataset for a very small number of
## iterations  (500).
accept_rate(test1)
## Calculate accept rates. Will get:

#Acceptance rate of reversible jump proposals =  32.5581 % 
#Acceptance rate of Metropolis-Hastings proposals =  76.8595 %

conting documentation built on May 1, 2019, 8:47 p.m.