ensure_matrix_symmetry {graphicalExtremes} | R Documentation |
Ensure numerical matrix symmetry/zero values
Description
Ensures the symmetry of a square matrix by averaging it with its transpose. Optionally verifies that the matrix was close to symmetric before.
Makes sure zeros are "numerically zero", by truncating all small values.
Usage
ensure_matrix_symmetry(M, checkTol = Inf, alert = NULL)
truncate_zeros(M, tol = get_small_tol())
ensure_matrix_symmetry_and_truncate_zeros(
M,
tol = get_small_tol(),
checkTol = Inf
)
Arguments
M |
Numeric square matrix. |
checkTol |
Positive scalar. If the maximum absolute difference between |
alert |
Passed to |
tol |
All entries with absolute value below this value are truncated to zero. |
Value
The adjusted value of M
.
See Also
Other input validation functions:
checkGamma()
,
check_graph()
,
check_partial_matrix_and_graph()
[Package graphicalExtremes version 0.3.2 Index]