if (FALSE) {
data("sx2")
data_in = as.matrix(sx2,ncol = 2)
n_iter = 300
in_g = 2
n = dim(data_in)[1]
model_string <- "VEI"
in_model_type <- switch(model_string, "EII" = 0,"VII" = 1,
"EEI" = 2, "EVI" = 3, "VEI" = 4, "VVI" = 5, "EEE" = 6,
"VEE" = 7, "EVE" = 8, "EEV" = 9, "VVE" = 10,
"EVV" = 11,"VEV" = 12,"VVV" = 13)
zigs_in <- z_ig_random_soft(n,in_g)
m2 = main_loop_st(X = t(data_in), # data in has to be in column major form
G = 2, # number of groups
model_id = 1, # model id for parallelization later
model_type = in_model_type,
in_zigs = zigs_in, # initializaiton
in_nmax = n_iter, # number of iterations
in_l_tol = 0.5, # likilihood tolerance
in_m_iter_max = 20, # maximium iterations for matrices
anneals=c(1),
in_m_tol = 1e-8)
plot(sx2,col = MAP(m2$zigs) + 1, cex = 0.5, pch = 20)
}
Run the code above in your browser using DataLab