Description
When the VEM algorithm does not converge, the function GREMLINS::multipartiteBM simply fails. It would be desirable to get a result, perhaps with a warning about sub-optimality.
ReprEx
set.seed(78916)
x <- replicate(3, runif(10000)|> matrix(100), simplify = FALSE) # Generate some data
# Format it for GREMLINS
y <- lapply(seq_along(x), function(i){
GREMLINS::defineNetwork(x[[i]], rowFG = i, colFG = i+1,
typeInter = 'inc')
})
# Run MBM
res <- GREMLINS::multipartiteBM(y, v_distrib = rep('gaussian', 3),
namesFG = 1:4,
v_Kmin = rep(4, 4), v_Kmax = rep(5, 4))
res
Expected/Desired behviour
Returns a result in the usual format, perhaps with a warning about the lack of convergence
Behaviour
[1] "------------Nb of entities in each functional group--------------"
1 2 3 4
100 100 100 100
[1] "------------Probability distributions on each network--------------"
[1] "gaussian" "gaussian" "gaussian"
[1] "-------------------------------------------------------------------"
[1] " ------ Searching the numbers of blocks starting from [ 4 4 4 4 ] blocks"
[1] "ICL : -Inf . Nb of blocks: [ 3 4 4 4 ] . Convergence was not reached here."
Error in multipartiteBM(list(list_Net[[e]]), namesFG = dataR6$namesFG[indFG], :
Convergence was not reached. Increase the number of iterations of the VEM or of the VE
> res
Error: object 'res' not found
Note
The unexpected/undesirable behaviour affects also GREMLINS::multipartiteBMFixedModel:
Code
# Using the same data and seed
res <- GREMLINS::multipartiteBMFixedModel(y, v_distrib = rep('gaussian', 3),
namesFG = 1:4, v_K = rep(4, 4))
Output
[1] "====================== First Forward Step =================="
[1] "====================== First Backward Step =================="
Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x), :
'data' must be of a vector type, was 'NULL'
Description
When the VEM algorithm does not converge, the function
GREMLINS::multipartiteBMsimply fails. It would be desirable to get a result, perhaps with a warning about sub-optimality.ReprEx
Expected/Desired behviour
Returns a result in the usual format, perhaps with a warning about the lack of convergence
Behaviour
Note
The unexpected/undesirable behaviour affects also
GREMLINS::multipartiteBMFixedModel:Code
Output