| lugsail_gr | R Documentation |
Computes the upgraded Gelman-Rubin convergence statistics (\hat{R}_L and \hat{R}^p_L),
Effective Sample Size (\widehat{\mathrm{ESS}}), and principled termination thresholds (\delta_{\epsilon})
proposed by Vats and Knudson (2021) using replicated lugsail batch means variance estimators.
lugsail_gr(x, alpha = 0.05, epsilon = 0.1, b = NULL, multivariate = TRUE)
x |
Input MCMC chain output. Can be a numeric vector (single univariate chain),
matrix of dimension |
alpha |
Numeric, significance level for the confidence region (default |
epsilon |
Numeric, relative volume tolerance for target precision (default |
b |
Optional batch size for lugsail batch means. If |
multivariate |
Logical, if |
An object of class "lugsail_gr" containing:
psrf |
Vector of univariate lugsail potential scale reduction factors |
mpsrf |
Multivariate lugsail potential scale reduction factor |
ess |
Vector of univariate effective sample sizes for each parameter. |
mess |
Multivariate effective sample size |
delta_eps |
Principled target threshold |
M_alpha_eps_p |
Minimum required effective sample size bound |
converged |
Logical, indicating if diagnostic has converged ( |
means |
Posterior sample mean vector across chains. |
sd |
Posterior standard deviation vector. |
s2 |
Sample variance (scalar or matrix |
tau_L |
Replicated lugsail variance/covariance matrix estimate |
n |
Chain length (number of iterations per chain). |
m |
Number of parallel chains. |
p |
Number of parameter dimensions. |
alpha |
Significance level. |
epsilon |
Relative volume tolerance. |
Vats, D. and Knudson, C. (2021). Revisiting the Gelman–Rubin Diagnostic. Statistical Science, 36(4), 518–529. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/20-STS812")}.
Gelman, A. and Rubin, D. B. (1992). Inference from iterative simulation using multiple sequences. Statistical Science, 7(4), 457–472. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1214/ss/1177011136")}.
Brooks, S. P. and Gelman, A. (1998). General methods for monitoring convergence of iterative simulations. Journal of Computational and Graphical Statistics, 7(4), 434–455. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1080/10618600.1998.10474787")}.
# Example 1: Univariate MCMC output (3 chains of 1000 iterations)
set.seed(123)
chain1 <- rnorm(1000, mean = 0, sd = 1)
chain2 <- rnorm(1000, mean = 0.05, sd = 1)
chain3 <- rnorm(1000, mean = -0.05, sd = 1)
res1 <- lugsail_gr(list(chain1, chain2, chain3))
print(res1)
# Example 2: Multivariate MCMC output (2 chains of 500 iterations, 2 parameters)
mat1 <- matrix(rnorm(1000), ncol = 2)
mat2 <- matrix(rnorm(1000), ncol = 2)
res2 <- lugsail_gr(list(mat1, mat2))
summary(res2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.