R/s.hat.R

Defines functions s.hat

# We don't use this anymore. This was before we learned about replicated batch means.

s.hat <- function(x){

  # Define some notation.
  Nvar <- ncol(x[[1]]) # number of variables
  Nchain <- length(x)
  
	Si2 <- array(sapply(x, var, simplify = TRUE), dim = c(Nvar, Nvar, Nchain)) 
	W <- apply(Si2, c(1, 2), mean) # Average the vcov matrices across chains. #aka S
	W
}

Try the stableGR package in your browser

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

stableGR documentation built on Oct. 8, 2022, 1:05 a.m.