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 numerical vectors of length p with user-provided degrees of vertices for each class. If there is only one vector, we assume degrees are the same for all K classes. In that case parameter K (number of classes) must be provided. Note that for successful _jewel_ estimation true degrees are not necessary: for example, user can provide a vector where known hubs have degree 10 and the rest of the vertices have degree 1.

K

number of classes (i.e. datasets, i.e. desired graphs). By default it is length(d). In length(d) = 1, K must be provided by the user.

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)
}

[Package jewel version 2.0.1 Index]