Cholesky(Matrix)
Cholesky()所属R语言包:Matrix
Cholesky Decomposition of a Sparse Matrix
稀疏矩阵的Cholesky分解
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Computes the Cholesky decomposition of a sparse, symmetric, positive-definite matrix. However, typically chol() should rather be used unless you are interested in the different kinds of sparse Cholesky decompositions.
计算稀疏,对称正定矩阵的Cholesky分解。然而,通常chol()而应被使用,除非你是在稀疏的Cholesky分解不同种类的兴趣。
用法----------Usage----------
Cholesky(A, perm = TRUE, LDL = !super, super = FALSE, Imult = 0, ...)
参数----------Arguments----------
参数:A
sparse symmetric matrix. No missing values or IEEE special values are allowed.
稀疏对称矩阵。没有遗漏值或IEEE特殊值是不允许的。
参数:perm
logical scalar indicating if a fill-reducing permutation should be computed and applied to the rows and columns of A. Default is TRUE. </table>
如果填充减少置换应计算,并应用到行和列A逻辑标表示。默认TRUE。 </ TABLE>
参数:LDL
logical scalar indicating if the decomposition should be computed as LDL' where L is a unit lower triangular matrix. The alternative is LL' where L is lower triangular with arbitrary diagonal elements. Default is TRUE. Setting it to NA leaves the choice to a CHOLMOD-internal heuristic.
逻辑标表示如果计算为低密度脂蛋白的分解应L是一个单位下三角矩阵。另一种方法是LLL是较低的任意对角线元素的三角。默认TRUE。将它设置为NA留下一个CHOLMOD内部启发式的选择。
参数:super
logical scalar indicating is a supernodal decomposition should be created. The alternative is a simplicial decomposition. Default is FALSE. Setting it to NA leaves the choice to a CHOLMOD-internal heuristic.
逻辑标表示是1 supernodal分解应建立。替代的是一个单纯的分解。默认FALSE。将它设置为NA留下一个CHOLMOD内部启发式的选择。
参数:Imult
numeric scalar which defaults to zero. The matrix that is decomposed is A+m*I where m is the value of Imult and I is the identity matrix of order ncol(A).
数字标默认为零。分解矩阵A+m*I其中mImult的价值和I是为了ncol(A)身份矩阵。
参数:...
further arguments passed to or from other methods.
通过进一步的论据或其他方法。
Details
详情----------Details----------
This is a generic function with special methods for different types of matrices. Use showMethods("Cholesky") to list all the methods for the Cholesky generic.
这是一个特殊的方法,为不同类型的矩阵通用功能。使用showMethods("Cholesky")Cholesky通用列出所有的方法。
The method for class dsCMatrix of sparse matrices — the only one available currently — is based on functions from the CHOLMOD library.
类的方法dsCMatrix稀疏矩阵 - 只有一个目前 - 基于从CHOLMOD库的功能。
Again: If you just want the Cholesky decomposition of a matrix, you should probably rather use chol(.).
还是那句话:如果你只是想一个矩阵的Cholesky分解,你应该可能,而使用chol(.)。
值----------Value----------
an object inheriting from either "CHMsuper", or "CHMsimpl", depending on the super argument; both classes extend "CHMfactor" which extends "MatrixFactorization".
对象继承是"CHMsuper"或"CHMsimpl",super参数取决于两个班延长"CHMfactor"延伸"MatrixFactorization"。
In other words, the result of Cholesky() is not a matrix, and if you want one, you should probably rather use chol().
换句话说,结果Cholesky()是不是一个矩阵,如果你想要一个,而应该使用chol()。
参考文献----------References----------
CHOLMOD: sparse supernodal Cholesky factorization and update/downdate http://www.cise.ufl.edu/research/sparse/cholmod/
Direct Methods for Sparse Linear Systems, SIAM Series “Fundamentals of Algorithms”.
参见----------See Also----------
Class definitions CHMfactor and dsCMatrix and function expand. Note the extra solve(*, system = . ) options in CHMfactor.
类定义CHMfactor和dsCMatrix“函数”expand。在solve(*, system = . )注意额外CHMfactor选项。
Note that chol() returns matrices (inheriting from "Matrix") whereas Cholesky() returns a "CHMfactor" object, and hence a typical user will rather use chol(A).
注意chol()回报矩阵(继承"Matrix"的)而Cholesky()的返回一个"CHMfactor"对象,因此,一个典型的用户,而将使用chol(A)。
举例----------Examples----------
data(KNex)
mtm <- with(KNex, crossprod(mm))
str(mtm@factors) # empty list()[空列表()]
(C1 <- Cholesky(mtm)) # uses show(<MatrixFactorization>)[使用展(<MatrixFactorization>)]
str(mtm@factors) # 'sPDCholesky' (simpl)[sPDCholesky(SIMPL)]
(Cm <- Cholesky(mtm, super = TRUE))
c(C1 = isLDL(C1), Cm = isLDL(Cm))
str(mtm@factors) # 'sPDCholesky' *and* 'SPdCholesky'[“sPDCholesky*和*SPdCholesky”]
str(cm1 <- as(C1, "sparseMatrix"))
str(cmat <- as(Cm, "sparseMatrix"))# hmm: super is *less* sparse here[HMM:超*少*稀疏这里]
cm1[1:20, 1:20]
b <- matrix(c(rep(0, 711), 1), nc = 1)
## solve(Cm, b) by default solves Ax = b, where A = Cm'Cm ![#解决(CM,B)默认情况下,解决了AX = B,其中A = CmCm!]
## hence, the identical() check *should* work, but fails on some GOTOblas:[#因此,相同的()检查*应*工作,但失败对一些GOTOblas:]
x <- solve(Cm, b)
stopifnot(identical(x, solve(Cm, b, system = "A")),
all.equal(x, solve(mtm, b)))
Cn <- Cholesky(mtm, perm = FALSE)# no permutation -- much worse:[没有置换 - 糟糕得多:]
sizes <- c(simple = object.size(C1),
super = object.size(Cm),
noPerm = object.size(Cn))
format(cbind(100 * sizes / sizes[1]), digits=4)
## Visualize the sparseness:[#可视化的稀疏:]
dq <- function(ch) paste('"',ch,'"', sep="") ## dQuote(<UTF-8>) gives bad plots[#dQuote(<UTF-8>)坏图]
image(mtm, main=paste("crossprod(mm) : Sparse", dq(class(mtm))))
image(cm1, main= paste("as(Cholesky(crossprod(mm)),\"sparseMatrix\"):",
dq(class(cm1))))
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|