RF {blockmodelingTest} | R Documentation |
The function calculates the value of the Relative Fit function.
RF(res, k = 10, loops = TRUE)
res |
An object returned by the function |
k |
The number of randomized networks for the estimation of the expected value of a criterion function. It has to be as high as possible. |
loops |
Whether loops are allowed in randomized networks or not, default |
The function randomizes an empirical network to compute the value of the Relative Fit function. The networks are ranomized in such a way that the values on the links are randomly relocated.
RF
- The value of the Relative Fit function.
err
- The value of a criterion function that is used for blockmodeling (for empirical network).
rand.err
- A vector with the values of the criterion funcion that is used for blockmodeling (for randomized networks).
Marjan Cugmas and Ales Ziberna
Cugmas, M., Ziberna, A., & Ferligoj, A. (2019). Mechanisms Generating Asymmetric Core-Cohesive Blockmodels. Metodoloski Zvezki, 16(1), 17-41.
optRandomParC
n <- 8 # If larger, the number of partitions increases dramatically as does if we increase the number of clusters net <- matrix(NA, ncol = n, nrow = n) clu <- rep(1:2, times = c(3, 5)) tclu <- table(clu) net[clu == 1, clu == 1] <- rnorm(n = tclu[1] * tclu[1], mean = 0, sd = 1) net[clu == 1, clu == 2] <- rnorm(n = tclu[1] * tclu[2], mean = 4, sd = 1) net[clu == 2, clu == 1] <- rnorm(n = tclu[2] * tclu[1], mean = 0, sd = 1) net[clu == 2, clu == 2] <- rnorm(n = tclu[2] * tclu[2], mean = 0, sd = 1) res <- optRandomParC(M = net, k = 2, rep = 10, approaches = "hom", homFun = "ss", blocks = "com") RF(res = res, k = 100, loops = TRUE)