emxCholeskyVariance: Create a variance matrix in Cholesky form

Description Usage Arguments Details Value See Also Examples

View source: R/emxBehaviorGenetics.R

Description

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

Usage

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

Arguments

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.

Details

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.

Value

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.

See Also

emxGeneticFactorVariance

Examples

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

EasyMx documentation built on Jan. 30, 2020, 5:07 p.m.