Calculates the effective sampling rate (esr
) based on the formula
$$\frac{1}{1 + 2 \sum_{k = 1}^\infty\rho_k(\theta)}$$
in Brooks et al. (2011).
The infinite sum is truncated at
lag \(k\) when \(\rho_{k+1}(\theta) < 0\).
esr(x, ...)# S3 method for mcarray
esr(x, by = "all", ...)
# S3 method for mcmc
esr(x, by = "all", ...)
# S3 method for mcmc.list
esr(x, by = "all", ...)
# S3 method for mcmcarray
esr(x, by = "all", as_df = FALSE, ...)
# S3 method for mcmcr
esr(x, by = "all", as_df = FALSE, ...)
# S3 method for mcmcrs
esr(x, by = "all", ...)
An MCMC object
Unused
A string indicating whether to return the estimates by the object ("all"), "parameter" or "term"
A flag indicating whether to return the estimates as a tibble versus a list.
The esr value(s) as a tibble or list
mcarray
: Effective Sampling Rate for an mcarray object
mcmc
: Effective Sampling Rate for an mcmc object
mcmc.list
: Effective Sampling Rate for an mcmc.list object
mcmcarray
: Effective Sampling Rate for an mcmcarray object
mcmcr
: Effective Sampling Rate for an mcmcr object
mcmcrs
: Effective Sampling Rate for an mcmcrs object
Brooks, S., Gelman, A., Jones, G.L., and Meng, X.-L. (Editors). 2011. Handbook for Markov Chain Monte Carlo. Taylor & Francis, Boca Raton.
# NOT RUN {
esr(mcmcr_example)
# }
Run the code above in your browser using DataLab