Open garyzhubc opened 12 months ago
@garyzhubc The code for function varbvspve
illustrates how to do this.
I'm seeing this loop
pve <- rep(0, nr)
for (i in 1:nr) {
j <- sample(ns, 1, prob = fit$w)
b <- with(fit, mu[, j] + sqrt(s[, j]) * rnorm(p))
b <- b * (runif(p) < fit$alpha[, j])
sz <- c(var1(X %*% b))
pve[i] <- sz/(sz + fit$sigma[j])
}
Is b here a posterior sample of inclusion?
How to sample from the posterior?