is.invertible: Invertible Matrix

Description Usage Arguments Value Author(s) References Examples

View source: R/is.R

Description

Checks if a square matrix is invertible.

Usage

1
is.invertible(X, tol = 1e-08, stop = FALSE)

Arguments

X

Numeric matrix. Square matrix.

tol

Numeric. Tolerance.

stop

Logical. If TRUE, stops and returns an error with any of the following conditions: X is not a square matrix, or X is not invertible, that is, a singular matrix.

Value

Returns TRUE if the matrix is invertible. Returns FALSE if the matrix is not invertible, that is, singular.

Author(s)

Ivan Jacob Agaloos Pesigan

References

Wikipedia: Invertible Matrix Wikipedia: Singular Matrix

Examples

1
2
3
4
5
6
7
8
9
Sigma <- matrix(
  data = c(
    225, 112.50, 56.25,
    112.5, 225, 112.5,
    56.25, 112.50, 225
  ),
  ncol = 3
)
is.invertible(X = Sigma)

jeksterslabds/jeksterslabRmatrix documentation built on Aug. 4, 2020, 5:18 a.m.