Mostly for internal use, function called by GE_bias_normal() and GE_scoreeq_sim() to translate the rho_list inputs and return a total covariance matrix for simulation/ checking validity of covariance structure. If invalid covariance structure, will stop and return an error message.

1 | ```
GE_translate_inputs(beta_list, rho_list, prob_G, cov_Z = NULL, cov_W = NULL)
``` |

`rho_list` |
A list of the 6 pairwise covariances between the covariates. These should be in the order (1) cov_GE (2) cov_GZ (3) cov_EZ (4) cov_GW (5) cov_EW (6) cov_ZW. If Z or M are vectors then terms like cov_GZ should be vectors (in the appropriate order). If Z or M are vectors, then cov_ZW should be a vector in the order (cov(Z_1,W_1),...,cov(Z_1,W_q), cov(Z_2,W_1),........,cov(Z_p,W_q) where Z is a vector of length p and W is a vector of length q. |

`prob_G` |
Probability that each allele is equal to 1. Since each SNP has two alleles, the expectation of G is 2*prob_G. |

`cov_Z` |
Only used if Z is a vector, gives the covariance matrix of Z (remember by assumption Z has mean 0 and variance 1). The (i,j) element of the matrix should be the (i-1)(i-2)/2+j element of the vector. |

`cov_W` |
Only used if W is a vector, gives the covariance matrix of W (remember by assumption W has mean 0 and variance 1). The (i,j) element of the matrix should be the (i-1)(i-2)/2+j element of the vector. |

A list with the elements:

`sig_mat_total` |
The sigma parameter for rmvnorm call to generate our data. |

`sig_mat_ZZ` |
The covariance matrix of Z, i.e. E[ZZ^T] |

`sig_mat_WW` |
The covariance matrix of W, i.e. E[WW^T] |

1 2 |

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.