Det | R Documentation |
Returns the determinant of a square matrix X
,
computed either by Gaussian elimination, expansion by cofactors, or as the product of the eigenvalues of the matrix.
If the latter, X
must be symmetric.
Det(
X,
method = c("elimination", "eigenvalues", "cofactors"),
verbose = FALSE,
fractions = FALSE,
...
)
X |
a square matrix |
method |
one of '"elimination"' (the default), '"eigenvalues"', or '"cofactors"' (for computation by minors and cofactors) |
verbose |
logical; if |
fractions |
logical; if |
... |
arguments passed to |
the determinant of X
John Fox
det
for the base R function
gaussianElimination
, Eigen
Other determinants:
adjoint()
,
cofactor()
,
minor()
,
rowCofactors()
,
rowMinors()
A <- matrix(c(1,2,3,2,5,6,3,6,10), 3, 3) # nonsingular, symmetric
A
Det(A)
Det(A, verbose=TRUE, fractions=TRUE)
B <- matrix(1:9, 3, 3) # a singular matrix
B
Det(B)
C <- matrix(c(1, .5, .5, 1), 2, 2) # square, symmetric, nonsingular
Det(C)
Det(C, method="eigenvalues")
Det(C, method="cofactors")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.