Skip to contents

Helper to create models, which substitute in a symmetric matrix for a value.

Usage

subSymm(m, x, y, val)

Arguments

m

The symmetric matrix

x

Row position

y

Column position

val

Value to insert in the given position

Value

The symmetric matrix with the value inserted in the right positions

Examples

m <- matrix(0, ncol = 3, nrow = 3)
subSymm(m, 1, 2, 1)
#>      [,1] [,2] [,3]
#> [1,]    0    1    0
#> [2,]    1    0    0
#> [3,]    0    0    0