Provides a set of handy but crude functions in order to simulate FC matrices starting from a model. Functions for simulating networks perturbations are provided as well with some strict assumptions.

polishMat() Polishes a matrix which has been subject to weird shenanigans. Values are re-confined to the range c(-1, 1) and the diagonal is restored.

simulateMat() Simulates Nmat matrices from a template matrix by adding gaussian noise with sd = mat_variability.

biasMat() Adds to a specific network of a list of matrices a systematic drift which is a function of a given behavioral score.

noiseMat() Adds to a specific network of a list of matrices a randomly-distributed noise which is a function of a given behavioral score.

polishMat(mat)

simulateMat(mat, Nmat, mat_variability)

biasMat(
  matrices,
  y,
  network1,
  network2,
  bias_multiplier,
  bias_variability,
  mat_variability
)

noiseMat(matrices, y, network1, network2, noise_multiplier)

Arguments

mat

A square matrix used as template

Nmat

Number of matrices to simulate from the template

mat_variability

SD of the gaussian noise used to simulate different matrices/individuals

matrices

List of lists of FC matrices such as the one created by simulateMat().

y

the behavioral score according to which networks will be biased or perturbed. Recommended to be scaled.

network1

Indices of the first network to perturb

network2

Indices of the second network to perturb. If indices are the same as those of network1 signal will be injected within one network, else signal will be injected into the interaction between networks.

bias_multiplier

The network will be perturbed according to this parameter. At state, bias multiplier will be added or subtracted according to the individual performance in y.

bias_variability

Add a randomly distributed value with mean 0 and sd bias_variability to the previous parameters such that participants may present variability of predictivity within the perturbed network.

noise_multiplier

Adds further gaussian noise within a network, with mean 0 and sd= noise_multiplier, according to the individual performance in y. Worst performances are injected with the entire noise_multiplier variability. Best performances are injected with a minor variability.

Value

A squared matrix or a list of matrices which have been polished after a simulation with, for example, random variability or systematic drift.