Calculates the effective sample size (ESS) for one or more MCMC chains, discarding an initial burn-in.

ESS(values, burnin, Summarize = min)

Arguments

values

Either a numeric matrix (samples × parameters) or a list of such matrices, each representing an independent MCMC run.

burnin

Integer giving the number of initial samples to discard.

Summarize

Function to summarize ESS values across runs (default: min).

Value

ESS() returns a numeric vector of effective sample sizes for each parameter. When multiple runs are supplied, the summarized ESS across runs is returned.

Details

If a list of chains is supplied, ESS() applies the calculation to each chain and summarizes results across chains using the specified summary function.

The effective sample size is estimated using ess from the mcmcse package. Burn-in samples are removed using BurnOff() prior to calculation.

See also

PSRF() for potential scale reduction diagnostics.