make.symmetric: Make a square matrix symmetric by averaging.
Description
Matrix symmetry might depend on numerical precision issues.
There is a bug in JAGS related to this issue for multivariate
normal nodes. This simple function can fix the issue.
Usage
make.symmetric(x)
Arguments
x
A square matrix.
Value
A symmetric square matrix.
encoding
UTF-8
Details
The function takes the average of (x[i, j] + x[j, i]) / 2 for each off diagonal cells.