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
|
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
|
int |
a vector of two numbers, |
ncores |
number of cores to use in parallel data generation.
If |
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
-
Graphs
– a list of adjacency matrices of theK
generated graphs. -
CommomGraph
- a matrix, common part (intersection) of theK
generated graphs. -
Data
- a list of lists, for each sample size of the input vectorn
one obtainsK
data matrices, each of the sizen_l
byp
. -
Sigma
- a list ofK
covariance matrices of the sizep
byp
.
Examples
data <- generateData_rewire(K = 3, p = 50, n = 20, ncores = 1, verbose = FALSE)