View source: R/903_post_hoc_fns.R
| s2m_B | R Documentation |
This is a wrapper function to perform the sequential 2-means variable selection method @li2017variable on the reconstructed tensor from the posterior draws of betas.
s2m_B(B, sigma = NULL)
B |
The reconstructed tensor from the posterior draws of betas. This
should have dimension |
sigma |
The value for the distance at which two cluster centers are
determined to be the same. This value defaults to the median value for
the posterior standard deviation of the voxel-wise draws in |
An array of dimension D + 1.
# In this case, the value for D is 2
true_B <- rbind(
c(0,0,0,0,0),
c(0,0,1,0,0),
c(0,1,1,1,0),
c(0,0,1,0,0),
c(0,0,0,0,0)
)
sim_B <- array(NA, dim = c(5,5,500)) # Simulating 500 draws
for(s in 1:500) {
sim_B[,,s] <- rnorm(25,mean = c(true_B), sd = 0.3)
}
final_estimate <- s2m_B(sim_B)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.