Skip to contents

stm_symmetric_from_vector() generates a symmetric matrix from a given vector. The function calls another matrix function to create the matrix.

Usage

stm_symmetric_from_vector(vec)

Arguments

vec

A numeric vector. The vector from which the symmetric matrix is created.

Value

A symmetric matrix created from the input vector.

Details

This function relies on stm_matrix_lus() to generate the matrix.

Examples

v <- c(1, 2, 3, 4, 5, 6)
print(v)
#> [1] 1 2 3 4 5 6
stm_symmetric_from_vector(v)
#>      [,1] [,2] [,3]
#> [1,]    2    3    5
#> [2,]    1    2    6
#> [3,]    2    4    2