Learn R Programming

DCA (version 2.0)

la.simu.gen: Simulate a data matrix with underlying dynamic correlation signal in the Liquid Association (LA) framework

Description

The simulation follows the LA framework, namely dynamic correlation is in the form of X~N(0,1), Y~N(0,1), Z~N(0,1), E(XY|Z) is a function of Z.

Usage

la.simu.gen(n, p, n.grp, n.noise.gene, rho, pwr)

Arguments

n

Sample size (number of columns of the data matrix).

p

The number of genes in each LA module, i.e. a group of genes regulated by the same latent dynamic correlation factor.

n.grp

The number of LA modules to simulate.

n.noise.gene

The number of pure noise genes to add to the matrix.

rho

The standard deviation of the Gaussian noise to be added to the simulated data in the modules.

pwr

The power for the transformation (see details)

Value

A list is returned.

dat

The data matrix.

z

The true z vectors.

Details

Between modules, the latent LA factor z's are independent.

Within each module, 10 sub-modules are simulated. For each sub-module, we first generate a pair of X and Y vectors, which follows:

X~N(0,1), Y~N(0,1) u=(pnorm(z)-0.5)*2 E(XY|z)=sign(u)*abs(u)^pwr

Then white noise with SD of rho is added to the hidden X, Y pair to generate pairs of observed X, Y vectors.

See Also

dca()

Examples

Run this code
# NOT RUN {
x<-la.simu.gen(n=100,p=200,n.grp=3, n.noise.gene=100, rho=0.5, pwr=1)
x$dat[1:5,1:5]
x$z[1:5,]
# }

Run the code above in your browser using DataLab