- isLDL
(x)
returns a logical
indicating if
x
is an \(LDL'\) decomposition or (when FALSE
) an
\(LL'\) one.
- coerce
signature(from = "CHMfactor", to = "sparseMatrix")
(or equivalently, to = "Matrix"
or to = "triangularMatrix"
)
as(*, "sparseMatrix")
returns the lower triangular factor
\(L\) from the \(LL'\) form of the Cholesky factorization.
Note that (currently) the factor from the \(LL'\) form is always
returned, even if the "CHMfactor"
object represents an
\(LDL'\) decomposition.
Furthermore, this is the factor after any fill-reducing
permutation has been applied. See the expand
method for
obtaining both the permutation matrix, \(P\), and the lower
Cholesky factor, \(L\).
- coerce
signature(from = "CHMfactor", to = "pMatrix")
returns the permutation matrix \(P\), representing the
fill-reducing permutation used in the decomposition.
- expand
signature(x = "CHMfactor")
returns a list with
components P
, the matrix representing the fill-reducing
permutation, and L
, the lower triangular Cholesky factor.
The original positive-definite matrix \(A\) corresponds to the product
\(A = P'LL'P\). Because of fill-in during the decomposition the
product may apparently have more non-zeros than the original
matrix, even after applying drop0
to it. However,
the extra "non-zeros" should be very small in magnitude.
- image
signature(x = "CHMfactor"):
Plot the image of the
lower triangular factor, \(L\), from the decomposition. This method
is equivalent to image(as(x, "sparseMatrix"))
so the
comments in the above description of the coerce
method
apply here too.
- solve
signature(a = "CHMfactor", b = "ddenseMatrix"), system= *
:
The solve
methods for a "CHMfactor"
object take an
optional third argument system
whose value can be one of the
character strings "A"
, "LDLt"
, "LD"
,
"DLt"
, "L"
, "Lt"
, "D"
, "P"
or
"Pt"
. This argument describes the system to be solved. The
default, "A"
, is to solve \(Ax = b\) for \(x\) where
A
is the sparse, positive-definite matrix that was factored
to produce a
. Analogously, system = "L"
returns the
solution \(x\), of \(Lx = b\).
Similarly, for all system codes but "P"
and "Pt"
where, e.g., x <- solve(a, b, system="P")
is equivalent to
x <- P %*% b
.
See also solve-methods
.
- determinant
signature(x = "CHMfactor", logarithm =
"logical")
returns the determinant (or the logarithm of the
determinant, if logarithm = TRUE
, the default) of the
factor \(L\) from the \(LL'\) decomposition (even if the
decomposition represented by x
is of the \(LDL'\)
form (!)). This is the square root of the determinant (half the
logarithm of the determinant when logarithm = TRUE
) of the
positive-definite matrix that was decomposed.
%% since 0.999375-8 (2008-03-25):
- update
signature(object = "CHMfactor"), parent
. The
update
method requires an additional argument
parent
, which is either a
"'>dsCMatrix"
object, say \(A\), (with the
same structure of nonzeros as the matrix that was decomposed to
produce object
) or a general "'>dgCMatrix"
,
say \(M\), where \(A := M M'\) (== tcrossprod(parent)
)
is used for \(A\).
Further it provides an optional argument mult
, a numeric
scalar. This method updates the numeric values in object
to the decomposition of \(A+mI\) where \(A\) is the matrix
above (either the parent
or \(M M'\)) and \(m\) is
the scalar mult
. Because only the numeric values are
updated this method should be faster than creating and decomposing
\(A+mI\). It is not uncommon to want, say, the determinant of
\(A+mI\) for many different values of \(m\). This method
would be the preferred approach in such cases.