Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/generateToyData.R
This function generates toy data that can be used to run GADAG: the adjacency matrix of a DAG with p nodes and the design matrix with n observations of the distribution of the p nodes.
1 | generateToyData(n, p, edgemin = 0, type = "star", seed = 42)
|
n |
Number of samples in the design matrix. |
p |
Number of nodes of the DAG. |
edgemin |
Minimal value for the non-null edges of the DAG (between 0 and 1). |
type |
Form of the DAG. It can be chosen between 7 alternatives: |
seed |
Fix the seed. |
One of the following seven alternatives can be chosen for the DAG form:
"star"
star-shaped DAG (all active edges start from node 1),
"bistar"
half of the edges start from node 1 and the other half from node 2,
"full"
full DAG (all the edges are active),
"path"
path-shaped DAG (all the nodes are connected by a single path),
"quadristar"
node 1 is connected to nodes 2 to 4, each being connected to 1/3 of the rest of the nodes,
"sixstar"
same as "quadristar"
, with 6 nodes.
A list containing the design nxp matrix X (with samples in rows and variables in columns) and the adjacency matrix G associated to the DAG with p nodes.
Magali Champion, Victor Picheny and Matthieu Vignes.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | #############################################################
# Generating toy data
#############################################################
toy_data <- generateToyData(n=100, p=10)
# toy_data is a list of two matrices corresponding to a "star"
# DAG (node 1 activates all other nodes):
# - toy_data$X is a 100x10 design matrix
# - toy_data$G is the 10x10 adjacency matrix (ground trough)
## Not run:
# generate another type of data: a DAG with 100 nodes in a path form
toy_data <- generateToyData(n=100, p=100,type="path")
## End(Not run)
## Not run:
# set the minimal edge value to 1
toy_data <- generateToyData(n=100, p=10, edgemin=1) # all edges are set to 1
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.