diagDet {Matrix} | R Documentation |
Return the determinant (or log-determinant) of triangular matrices.
diagDet(x, logarithm=TRUE)
x |
a numeric vector representing the diagonal of a triangular or a diagonal matrix. |
logarithm |
logical.
When TRUE , the default, the logarithm of the
determinant is returned.
When FALSE , the determinant of
x is returned.
|
The determinant of a triangular matrix can be calculated from its diagonal elements only.
An object of class det
as a list with two elements
modulus |
a numeric value. The modulus (absolute value) of
the determinant or the logarithm of the modulus. The value
of the logarithm argument is included as an
attribute. |
sign |
a numeric value, which is +/- 1 according to whether the determinant is positive or negative. |
normal-bracket23bracket-normal
Often, computing the determinant is not what you should be doing to solve a given problem.
diagDet(1:5) # log of product diagDet(1:5, logarithm = FALSE)