View source: R/emxBehaviorGenetics.R

emxCholeskyVariance | R Documentation |

This function creates a Cholesky variance matrix and associated MxMatrix and MxAlgebra objects.

emxCholeskyVariance(x, name, values=.8, free=TRUE)

`x` |
character vector. The names of the variables used for the matrix. |

`name` |
character. The name of the variance matrix created. |

`values` |
numeric vector. The starting values for the lower triangular matrix. |

`free` |
logical vector. Whether the lower triangular elements are free. |

This is a helper function for creating a matrix that is symmetric and positive definite. Full covariance matrices are the most common case of these. In a behavior genetics modeling context, Cholesky components can be created for Additive genetics, Common environments, and unique Environments. These are unrestrictive models of the covariances of multiple phenotypes.

A list with two components. The first component is the lower triangular MxMatrix. The second component is an MxAlgebra, the result of which is the positive definite variance matrix.

emxGeneticFactorVariance

# Create a Cholesky variance matrix called 'A' require(EasyMx) nVar <- 3 x <- paste0('x', 1:nVar) amat <- emxCholeskyVariance(x, 'A')

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.