generateToyData: Generate toy data for running GADAG

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/generateToyData.R

Description

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.

Usage

1
generateToyData(n, p, edgemin = 0, type = "star", seed = 42)

Arguments

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: "star", "bistar", "full", "path", "quadristar", "sixstar" (see details below).

seed

Fix the seed.

Details

One of the following seven alternatives can be chosen for the DAG form:

Value

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.

Author(s)

Magali Champion, Victor Picheny and Matthieu Vignes.

See Also

GADAG, GADAG_Run.

Examples

 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)

magalichampion/GADAG documentation built on Jan. 11, 2018, 3:10 a.m.