set.seed(123)
y <- c(rnorm(40,0,0.3), rnorm(20,5,0.3))
g <- c(rep(1,30), rep(2, 30))
out <- sample_fiSAN(nrep = 500, burn = 200,
y = y, group = g,
nclus_start = 2,
maxK = 20, maxL = 20,
beta = 1)
traceplot(out, params = c("mu", "sigma2"), trunc_plot = 2)
Run the code above in your browser using DataLab