Skip to contents

Best ICL

Usage

best_ICL(models)

Arguments

models

a list of model with their ICL

Value

index of the model which has the best ICL

Examples


n1 = 100
n2 = 100
Q1=3
Q2=3
alpha1=c(.25,0.25, .5)
alpha2=c(0.10,0.4,0.5)
P <- matrix(c(0.9,0.6,0.4,0.7,0.5,0.3,0.5,0.3,0.1), Q1, Q2)
simulation1=robber::simulate_lbm(P,alpha1,alpha2,n1,n2)
M = simulation1$A
Z1 =simulation1$Z
Z2 =simulation1$W
G= 300
lambda_i =rbeta(n1,0.3,1.5)
mu_j = rbeta(n2,0.3,1.5)
lambda_i = lambda_i/max(lambda_i)
mu_j = mu_j/max(mu_j)
N0=lambda_i%*%t(mu_j)
N0 = N0*G
N=matrix(rpois(n1*n2,N0),nrow=n1)
R = M*N
obsrow = rowSums(R)>0
obscol = colSums(R)>0
R_obs = R[obsrow,obscol]
M_obs = M[obsrow,obscol]
R = M*N
models=fit_unsupervised_CoOP_LBM(R,exploOptions=list(plot=F))
#> [1] "k={ 1 , 1 }"
#> [1] "k={ 2 , 1 }"
#> [1] "k={ 1 , 2 }"
#> [1] "k={ 2 , 2 }"
#> [1] "k={ 3 , 1 }"
#> [1] "k={ 3 , 2 }"
#> [1] "k={ 1 , 3 }"
#> [1] "k={ 2 , 3 }"
#> [1] "k={ 3 , 3 }"
#> [1] "k={ 4 , 1 }"
#> [1] "k={ 4 , 2 }"
#> [1] "k={ 4 , 3 }"
#> [1] "k={ 1 , 4 }"
#> [1] "k={ 2 , 4 }"
#> [1] "k={ 3 , 4 }"
#> [1] "k={ 4 , 4 }"
#> [1] "k={ 5 , 1 }"
#> [1] "k={ 5 , 2 }"
#> [1] "k={ 5 , 3 }"
#> [1] "k={ 5 , 4 }"
#> [1] "CoOP-LBM : Best model has been fitted with 3-2 groups."
print(best_ICL(models))
#> 3-2 
#>   6