R/rejectionRate.R

Defines functions rejectionRate

Documented in rejectionRate

rejectionRate.mcmc <- function (x) {
  x <- as.matrix(x)
  apply(x[-nrow(x),,drop=FALSE] == x[-1,, drop=FALSE],2,mean)
}

rejectionRate.mcmc.list <- function (x) {
  apply(sapply(x,rejectionRate.mcmc),1,mean)
}

rejectionRate <- function(x) {
  UseMethod("rejectionRate")
}

Try the coda package in your browser

Any scripts or data that you put into this service are public.

coda documentation built on Oct. 24, 2020, 9:10 a.m.