vcconv: Convert between representations of (co-)variance structures

Description Usage Arguments Details Value Examples

Description

Convert between representations of (co-)variance structures (EXPERIMENTAL). See source code for details.

Usage

1
2
3
4
5
6
7
8
9
  mlist2vec(L)
  vec2mlist(v, n = NULL, symm = TRUE)
  vec2STlist(v, n = NULL)
  sdcor2cov(m)
  cov2sdcor(V)
  Vv_to_Cv(v, n = NULL, s = 1)
  Sv_to_Cv(v, n = NULL, s = 1)
  Cv_to_Vv(v, n = NULL, s = 1)
  Cv_to_Sv(v, n = NULL, s = 1)

Arguments

L

List of symmetric, upper-triangular, or lower-triangular square matrices.

v

Concatenated vector containing the elements of the lower-triangle (including the diagonal) of a symmetric or triangular matrix.

n

Number of rows (and columns) of the resulting matrix.

symm

Return symmetric matrix if TRUE or lower-triangular if FALSE.

m

Standard deviation-correlation matrix.

V

Covariance matrix.

s

Scale parameter.

Details

Value

(Co-)variance structure

Examples

1
2
vec2mlist(1:6)
mlist2vec(vec2mlist(1:6)) # approximate inverse

Example output

Loading required package: Matrix
$`1`
     [,1] [,2] [,3]
[1,]    1    2    3
[2,]    2    4    5
[3,]    3    5    6

11 12 13 14 15 16 
 1  2  3  4  5  6 
attr(,"clen")
1 
3 

lme4 documentation built on Aug. 18, 2018, 1:05 a.m.