constructWeights {jewel} | R Documentation |
Construct weights for _jewel_ minimization problem from prior information on vertices degrees.
Description
Function takes a numerical vector of vertices degrees and constructs weights with the rule W_ij = 1 / sqrt(d_i * d_j)
and then the whole matrix is normilized by the maximum.
Usage
constructWeights(d, K = NULL)
Arguments
d |
either one numerical vector or a list of |
K |
number of classes (i.e. datasets, i.e. desired graphs). By default it is length(d).
In length(d) = 1, |
Value
W - a list of K
numeric matrices of the size p
by p
Examples
{
K <- 3
p <- 50
n <- 20
data <- generateData_rewire(K = K, p = p, n = n, ncores = 1, verbose = FALSE)
G_list_true <- data$Graphs
true_degrees <- rowSums(G_list_true[[1]])
cut <- sort(true_degrees, decreasing = TRUE)[ceiling(p * 0.03)]
apriori_hubs <- ifelse(true_degrees >= cut, 10, 1)
W <- constructWeights(apriori_hubs, K = K)
}