Se and se_mean

I also want to know what se_mean is . I found a page for details . Note that I cannot understand it :’-D.

I guess that the se_mean is the standard deviation of the posterior means. However, according to the page, it seems to me that the calculation is done using efficient samples in some sense.

In the following, I made a code to extract posterior means for three chains and calculates the standard deviation of posterior means but it did not coincides with the se_mean.

stanmodelcode <- "
data {
  int<lower=0> N;
  real y[N];
} 

parameters {
  real mu;
} 

model {
  target += normal_lpdf(mu | 0, 10);
  target += normal_lpdf(y  | mu, 1);
} 
"

y <- rnorm(20) 
dat <- list(N = 20, y = y); 
fit <- stan(model_code = stanmodelcode, model_name = "example", 
            data = dat, iter = 2012, chains = 3, verbose = F,
            sample_file = file.path(tempdir(), 'norm.csv')) 

print(fit,digits_summary = 5)

mu <- extract(fit)$mu
mean(mu)
sd(mu)

 
a <- get_posterior_mean(fit)
x <- c(a[1,1],a[1,2],a[1,3])
sd(x)
sqrt(var(x)/length(x))
sqrt(var(c(a[1,1],a[1,2],a[1,3],a[1,4]))/4)