emxCholeskyVariance: Create a variance matrix in Cholesky form

View source: R/emxBehaviorGenetics.R

emxCholeskyVarianceR Documentation

Create a variance matrix in Cholesky form

Description

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

Usage

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

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


EasyMx documentation built on Feb. 16, 2023, 7:27 p.m.