R/nsims.R

Defines functions nsims.default nsims

Documented in nsims nsims.default

#' Number of Simulations
#'
#' Gets the number of simulations (iterations * chains)
#' of an MCMC object.
#'
#' @inheritParams params
#' @return An integer scalar of the number of simulations.
#' @family MCMC dimensions
#' @export
nsims <- function(x, ...) {
  UseMethod("nsims")
}

#' @description
#' The default methods returns the product of [nchains()] and [niters()].
#' @rdname nsims
#' @export
nsims.default <- function(x, ...) {
  nchains(x, ...) * niters(x, ...)
}

Try the universals package in your browser

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

universals documentation built on Sept. 22, 2022, 5:07 p.m.