lowertri2mat {changepoints}R Documentation

Transform a vector containing lower diagonal entries into a symmetric matrix of dimension p.

Description

Transform a vector containing lower diagonal entries into a symmetric matrix of dimension p.

Usage

lowertri2mat(lowertri_vec, p, diag = FALSE)

Arguments

lowertri_vec

A numeric vector containing lower diagonal entries.

p

A integer scalar of dimensionality.

diag

A logic scalar indicating if the diagonal entries are contained in lowertri_vec.

Value

A numeric p x p symmetric matrix.

Author(s)

Haotian Xu

Examples

A = matrix(1:16, 4, 4)
B = lowertri2mat(A[lower.tri(A)], 4, diag = FALSE)
C = lowertri2mat(A[lower.tri(A, diag = TRUE)], 4, diag = TRUE)

[Package changepoints version 1.1.0 Index]