generateData_rewire {jewel}R Documentation

Generate a set of scale-free graphs and corresponding datasets (using the graphs as their Gaussian graphical models)

Description

Function first generates K scale-free graphs with p vertices. They have the same order and degree distribution and share most of the edges, but some edges may vary (user can control how many). Function then generates corresponding precision and covariance matrices, all of the size p by p (see the paper for the details of the procedure). Then for each l-th element of vector n it generates K data matrices, each of the size n_l by p, i.e., for the same underlying graphs we can generate several sets of K datasets with different sample sizes.

Usage

generateData_rewire(
  K,
  p,
  n,
  power = 1,
  m = 1,
  perc = 0.05,
  int = NULL,
  ncores = NULL,
  makePlot = TRUE,
  verbose = TRUE
)

Arguments

K

number of graphs/data matrices.

p

number of nodes in the true graphs.

n

a numerical vector of the sample sizes for each desired set of K data matrices. Can be a vector of one element if the user wishes to obtain only one dataset of K matrices.

power

a number, power of preferential attachment for the Barabasi-Albert algorithm for the generation of the scale-free graph. Bigger number means more connected hubs. The default value is 1.

m

number of edges to add at each step of Barabasi-Albert algorithm for generation of the scale-free graph. The default value is 1.

perc

a number, tuning parameter for the difference between graphs. Number of trials to perform in the rewiring procedure of the first graph is p * perc. Bigger the number, more different are the graphs.

int

a vector of two numbers, a and b. Entries of precision matrices are sampled from the uniform distribution on the interval [-b, -a] + [a, b]. The default values are a = 0.2, b = 0.8.

ncores

number of cores to use in parallel data generation. If NULL, set to \#physical cores - 1.

makePlot

If makePlot = FALSE, plotting of the generated graphs is disabled. The default value is TRUE.

verbose

If verbose = FALSE, tracing information printing is disabled. The default value is TRUE.

Value

The following list is returned

Examples

data <- generateData_rewire(K = 3, p = 50, n = 20, ncores = 1, verbose = FALSE)

[Package jewel version 2.0.1 Index]