Description Usage Arguments Details Value Examples

View source: R/variancecomponentFunctions.R

noiseBgEffects simulates observational noise with a proportion of the effect shared across samples and a proportion independent across samples.

1 2 3 |

`N` |
Number [integer] of samples to simulate. |

`P` |
Number [integer] of phenotypes to simulate. |

`mean` |
Mean [double] of the normal distribution. |

`sd` |
Standard deviation [double] of the normal distribution. |

`sampleID` |
Prefix [string] for naming samples. |

`phenoID` |
Prefix [string] for naming traits. |

`shared` |
[bool] shared effect simulated if set to TRUE; at least one of shared or independent has to be set to TRUE. |

`independent` |
[bool] independent effect simulated if set to TRUE. |

`id_samples` |
Vector of [NrSamples] sample IDs [string]; if not provided constructed by paste(sampleID, 1:N, sep=""). |

`id_phenos` |
Vector of [NrTraits] phenotype IDs [string]; if not provided constructed by paste(phenoID, 1:P, sep=""). |

For the simulation of the observational noise effects, two components are used: i) matrix B [N x P] with vec(B) drawn from a normal distribution with mean=mean and sd=sd and ii) the trait design matrix A [P x P]. For the independent effect, A is a diagonal matrix with normally distributed values. A for the shared effect is a matrix of rowrank one, with normally distributed entries in row 1 and zeros elsewhere. To construct the final effects, the two matrices are multiplied as: E = BA^T.

Named list of shared noise effects (shared: [N x P] matrix) and independent noise effects (independent: [N x P] matrix), the covariance term of the shared effect (cov_shared: [P x P] matrix) and the covariance term of the independent effect (cov_independent: [P x P] matrix).

1 | ```
noiseBG <- noiseBgEffects(N=100, P=20, mean=2)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.