File: rejectionRate.R

package info (click to toggle)
r-cran-coda 0.13-2-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 456 kB
  • sloc: makefile: 2
file content (14 lines) | stat: -rw-r--r-- 276 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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")
}