Learn R Programming

backShift (version 0.1.4.3)

generateA: Generates a connectivity matrix A.

Description

Generates a connectivity matrix A with cycle product smaller than 1.

Usage

generateA(p, expNumNeigh, minCoef, maxCoef, cyclic, verbose = FALSE)

Arguments

p

Number of variables.

expNumNeigh

Expected number of neighbors, to be passed to randDAG.

minCoef

Minimal edge coefficient. The absolute magnitude of the coefficients will be sampled uniformly at random from the range \([minCoef, maxCoef]\).

maxCoef

Maximal edge coefficient. The absolute magnitude of the coefficients will be sampled uniformly at random from the range \([minCoef, maxCoef]\).

cyclic

If TRUE, connectivity matrix will contain at least one cycle.

verbose

If TRUE, comments will be printed.

Value

A list with two elements

  • A Connectivity matrix

  • sizeCycle Size of the cycle, if cyclic was set to TRUE.

Details

If expNumNeigh and maxCoef are large, function may fail to find a connectivity matrix with cycle product smaller one. In this case, try to lower these parameters.