GenerateExample: Generate example input data

Description Usage Arguments Details Value Author(s) Examples

View source: R/GraphAlignment.R

Description

Generate input data which can be used as an example.

Usage

1
2
GenerateExample(dimA, dimB, filling, covariance, symmetric = FALSE,
numOrths = 0, correlated = NA, distribution = "normal")

Arguments

dimA

size of network A

dimB

size of network B

filling

fraction of entries which are not explicitly set to zero

covariance

covariance of correlated rows and columns

symmetric

generate symmetric matrices

numOrths

number of diagonal elements to set to 1 in example matrix R

correlated

indices of correlated rows and columns

distribution

from which distribution are the values drawn ("normal" or "uniform")

Details

Symmetric example matrices A, B can be generated by specifying TRUE as the 'symmetric' argument. If the 'numOrths' argument is specified, a number of diagonal elements of R equal to the value will be set to 1. If a vector is specified as the 'correlated' argument, the specified rows and columns will be set to correlated values. Leaving this argument blank will result in pairwise correlations of all entries in A, B (or, if the matrices are of different rank, all elements of the smaller on will be correlated with the corresponding parts of the larger matrix).

Value

The return value is a list containing example matrices A (a), B (b) and R (r).

Author(s)

Joern P. Meier, Michal Kolar, Ville Mustonen, Michael Laessig, and Johannes Berg

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
ex <- GenerateExample(dimA = 170, dimB = 140, filling = 0.75,
                      covariance = 0.4, symmetric = TRUE, numOrths = 90,
                      correlated = 1:90, distribution = "normal")

##-- edge weight correlation
image(cor(ex$a[1:140, 1:140], ex$b))
hist(diag(cor(ex$a[1:140, 1:140], ex$b))[1:90])

##-- edge weight distribution
hist(ex$a[ex$a != 0]);
hist(ex$b[ex$b != 0]);

GraphAlignment documentation built on Nov. 8, 2020, 6:56 p.m.