#' @include mcmcstats-package.R
#' @exportMethod ess
NULL
#' Effective Sample Size (ESS)
setGeneric("ess",
function(x, ...) {
standardGeneric("ess")
})
setMethod("ess", "numeric",
function(x, ...) {
mcmcse::ess(x, ...)
})
setMethod("ess", "matrix", function(x, ...) {
t(apply(x, 2, ess, ...))
})
setMethod("ess", "array",
function(x, MARGIN=seq_along(dim(x))[-1], ...)
{
apply(x, MARGIN, ess, ...)
})
setMethod("ess", "list", function(x, ...) {
lapply(x, ess, ...)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.