R/nsamples.R

Defines functions nsamples.gMAP

Documented in nsamples.gMAP

#' Return the number of posterior samples
#'
#' @param object fitted model object
#' @template args-dots-ignored
#'
#'
#' @template example-start
#' @examples
#'
#' set.seed(34563)
#' map_AS <- gMAP(cbind(r, n - r) ~ 1 | study,
#'   family = binomial,
#'   data = AS,
#'   tau.dist = "HalfNormal", tau.prior = 1,
#'   beta.prior = 2
#' )
#'
#' nsamples(map_AS)
#'
#' @template example-stop
#'
#' @method nsamples gMAP
#' @aliases nsamples
#' @export
nsamples.gMAP <- function(object, ...) {
  return(
    object$fit@sim$chains *
      (object$fit@sim$iter - object$fit@sim$warmup)
  )
}

Try the RBesT package in your browser

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

RBesT documentation built on March 13, 2026, 5:06 p.m.