vech2full: Inverse vectorize a matrix

Description Usage Arguments Details Value Author(s) Examples

View source: R/utility.R

Description

These functions return the symmetric matrix that produces the given half-vectorization result.

Usage

1
2
3
vech2full(x)

vechs2full(x, diagonal = 1)

Arguments

x

A vector

diagonal

A value or vector of values to enter on the diagonal for vechs2full (default = 1)

Details

The input consists of a vector of the elements in the lower triangle of the resulting matrix (for vech2full, including the elements along the diagonal of the matrix, as a column vector), filled column-wise. For vechs2full, the diagonal values are filled as 1 by default, alternative values can be specified using the diag argument. The inverse half-vectorization takes a vector and reconstructs a symmetric matrix such that vech2full(vech(x)) is identical to x if x is symmetric.

Value

A symmetric matrix

Author(s)

Based on functions from the the OpenMx package

Examples

1
2
vech2full(c(1, 2, 3, 5, 6, 9))
vechs2full(c(2, 3, 6), diagonal = 0)

configural documentation built on Jan. 19, 2021, 1:06 a.m.