Skip to contents

stm_tril_from_vector() generates a lower triangular matrix from a given vector. The function calls another matrix function to generate the matrix.

Usage

stm_tril_from_vector(vec)

Arguments

vec

A numeric vector. The vector from which the lower triangular matrix is created.

Value

A lower triangular 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_tril_from_vector(v)
#>      [,1] [,2] [,3]
#> [1,]    1    0    0
#> [2,]    2    4    0
#> [3,]    3    5    6