R Under development (unstable) (2023-08-21 r84998 ucrt) -- "Unsuffered Consequences" Copyright (C) 2023 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details. R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > library(blockmodeling) To cite package 'blockmodeling' in publications please use package citation and (at least) one of the articles: Žiberna, Aleš (2007). Generalized blockmodeling of valued networks. Social Networks 29(1), 105-126. Žiberna, Aleš (2008). Direct and indirect approaches to blockmodeling of valued networks in terms of regular equivalence. Journal of Mathematical Sociology 32(1), 57–84. Žiberna, Aleš (2014). Blockmodeling of multilevel networks. Social Networks 39, 46–61. https://doi.org/10.1016/j.socnet.2014.04.002. Žiberna, Aleš (2023). Generalized and Classical Blockmodeling of Valued Networks, R package version 1.1.5. Cugmas, Marjan (2023). Generalized and Classical Blockmodeling of Valued Networks, R package version 1.1.5. To see these entries in BibTeX format, use 'format(, bibtex=TRUE)', or 'toBibtex(.)'. > nCores<-1 > clu <- c(1, 2, 1, 2, 1, 3, 2, 1, 1, 1, 1, 1, 3, 2, 4, 3, 4, 2, 2, 3) > data(baker) > > set.seed(2022) > res<-optRandomParC(baker>0,k=4, approaches = "bin", blocks = c("nul","com"),rep = 100, nCores = nCores) Starting optimization of the partiton 10 of 100 partitions. Starting optimization of the partiton 20 of 100 partitions. Starting optimization of the partiton 30 of 100 partitions. Starting optimization of the partiton 40 of 100 partitions. Starting optimization of the partiton 50 of 100 partitions. Starting optimization of the partiton 60 of 100 partitions. Starting optimization of the partiton 70 of 100 partitions. Starting optimization of the partiton 80 of 100 partitions. Starting optimization of the partiton 90 of 100 partitions. Starting optimization of the partiton 100 of 100 partitions. Optimization of all partitions completed 4 solution(s) with minimal error = 39 found. > plot(res) > print(res) Network size: 20 Approachs (paramter): bin Blocks (paramter) nul com Sizes of clusters: 1 2 3 4 5 2 6 7 IM 1 2 3 4 1 com com nul nul 2 com com com nul 3 nul com nul nul 4 nul nul nul nul Error: 39 4 solutions with minimal error exits. Only results for the first one are shown above! > > > resSS<-optRandomParC(baker>0,k=4, approaches = "hom", blocks = c("nul","com"),rep = 100, nCores = nCores) Starting optimization of the partiton 10 of 100 partitions. Starting optimization of the partiton 20 of 100 partitions. Starting optimization of the partiton 30 of 100 partitions. Starting optimization of the partiton 40 of 100 partitions. Starting optimization of the partiton 50 of 100 partitions. Starting optimization of the partiton 60 of 100 partitions. Starting optimization of the partiton 70 of 100 partitions. Starting optimization of the partiton 80 of 100 partitions. Starting optimization of the partiton 90 of 100 partitions. Starting optimization of the partiton 100 of 100 partitions. Optimization of all partitions completed 1 solution(s) with minimal error = 31.56667 found. > plot(resSS) > print(resSS) Network size: 20 Approachs (paramter): hom Blocks (paramter) nul com Sizes of clusters: 1 2 3 4 6 5 7 2 IM 1 2 3 4 1 com com com com 2 com com com com 3 com com com com 4 com com com com Error: 31.56667 > > resBll<-optRandomParC(baker>0,k=4, approaches = "hom", blocks = c("nul","com"),rep = 100, nCores = nCores, homFun="bll") Starting optimization of the partiton 10 of 100 partitions. Starting optimization of the partiton 20 of 100 partitions. Starting optimization of the partiton 30 of 100 partitions. Starting optimization of the partiton 40 of 100 partitions. Starting optimization of the partiton 50 of 100 partitions. Starting optimization of the partiton 60 of 100 partitions. Starting optimization of the partiton 70 of 100 partitions. Starting optimization of the partiton 80 of 100 partitions. Starting optimization of the partiton 90 of 100 partitions. Starting optimization of the partiton 100 of 100 partitions. Optimization of all partitions completed 1 solution(s) with minimal error = 129.7705 found. > plot(resBll) > print(resBll) Network size: 20 Approachs (paramter): hom-bll Blocks (paramter) nul com Sizes of clusters: 1 2 3 4 2 4 11 3 IM 1 2 3 4 1 com com com com 2 com com com com 3 com com com nul 4 com com com nul Error: 129.7705 > > # if(requireNamespace("StochBlockTest")){ > # StochBlockTest::llStochBlock(baker>0, clu=clu(resBll), addOne = FALSE, diagonal = "seperate") > # resSB<-StochBlockTest::stochBlockORP(baker>0,k = 4, rep = 100, addOne = FALSE, diagonal = "seperate") > # err(resSB) > # plot(resSB) > # crand(clu(resSB),clu(resBll)) > # } > > > tmp<-critFunC(baker>0, clu=clu, approaches = "hom", blocks = c("nul","rre"),homFun="bll", mulReg = TRUE) > plot(tmp) > tmp[["IM"]][1,,] [,1] [,2] [,3] [,4] [1,] "rre" "rre" "rre" "rre" [2,] "nul" "rre" "rre" "rre" [3,] "nul" "rre" "rre" "rre" [4,] "rre" "rre" "rre" "rre" > tmp[["EM"]][1,,] [,1] [,2] [,3] [,4] [1,] 0.06403202 0.04802402 22.180709778 6.028322580 [2,] 20.76828835 0.03601801 10.813469013 5.406734506 [3,] 0.03201601 13.49604347 0.016008005 0.008004003 [4,] 0.01600801 0.01200600 0.008004003 0.004002001 > > > tmp<-critFunC(baker>0, clu=clu, approaches = "hom", blocks = c("nul","com"),homFun="bll", mulReg = TRUE) > tmp$EM[1,,] [,1] [,2] [,3] [,4] [1,] 0.06403202 0.04802402 12.056645160 10.585011811 [2,] 11.22199962 13.52283927 16.300638384 6.748021735 [3,] 0.03201601 13.49604347 5.410736508 0.008004003 [4,] 8.99736231 7.63817002 0.008004003 0.004002001 > tmp$err [1] 131.7386 > plot(tmp) > critFunC(baker>0, clu=clu, approaches = "hom", blocks = c("nul","com"),homFun="bll", mulReg = TRUE, diag=2)$err [1] 131.7186 > > #if(requireNamespace("StochBlockTest")) StochBlockTest::llStochBlock(baker>0, clu=clu,addOne = FALSE) > > clu2L<-list(rep(1:2, each=5),rep(1:2, each=5)) > tmp<-critFunC(baker>0, clu=clu2L, approaches = "hom", blocks = c("nul","com"),homFun="bll", mulReg = TRUE) > > tmp$EM[1,,] [,1] [,2] [,3] [,4] [1,] 0.02501251 6.969234 12.51006 13.77700 [2,] 9.17312478 8.459184 14.82383 16.33545 [3,] 10.99174699 10.991747 10.01305 17.14825 [4,] 9.17312478 10.991747 16.82529 13.46524 > tmp$err [1] 195.536 > > > proc.time() user system elapsed 9.53 0.17 9.70