CHMfactor-class(Matrix)
CHMfactor-class()所属R语言包:Matrix
CHOLMOD-based Cholesky Factorizations
CHOLMOD基于Cholesky分解
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The virtual class "CHMfactor" is a class of CHOLMOD-based Cholesky factorizations of symmetric, sparse, compressed, column-oriented matrices. Such a factorization is simplicial (virtual class "CHMsimpl") or supernodal (virtual class "CHMsuper"). Objects that inherit from these classes are either numeric factorizations (classes "dCHMsimpl" and "dCHMsuper") or symbolic factorizations (classes "nCHMsimpl" and "nCHMsuper").
虚拟类"CHMfactor"是一类基于Cholesky分解的对称,稀疏,压缩,面向列的矩阵CHOLMOD。这种分解是单纯的(虚拟类"CHMsimpl")或supernodal(虚拟类"CHMsuper")。从这些类继承的对象是(类"dCHMsimpl"和"dCHMsuper")或(类"nCHMsimpl"和"nCHMsuper")符号分解的数字分解。
用法----------Usage----------
## S4 method for signature 'CHMfactor'
update(object, parent, mult = 0, ...)
isLDL(x)
参数----------Arguments----------
参数:object,x
a "CHMfactor" object.
"CHMfactor"对象。
参数:parent
a "dsCMatrix" matrix or "dgCMatrix" object with the same nonzero pattern as the matrix that generated object. If parent is a symmetric matrix (class "dsCMatrix") then object should be a decomposition of a matrix with the same nonzero pattern as parent. If parent is not symmetric then object should be the decomposition of a matrix with the same nonzero pattern as tcrossprod(parent).
"dsCMatrix"矩阵或"dgCMatrix"对象具有相同的非零矩阵生成object格局。 parent如果是一个对称矩阵(类"dsCMatrix")object应该是一个矩阵分解为parent具有相同的非零模式。 parent如果不是对称的,那么object应该是一个矩阵分解为tcrossprod(parent)具有相同的非零模式。
参数:mult
a numeric scalar (default 0). mult times the identity matrix is (implicitly) added to parent or tcrossprod(parent) before updating the decomposition object.
数字标(默认为0)。 mult身份矩阵(隐含的)添加到parent或tcrossprod(parent)更新分解object之前。
参数:...
Optional additional arguments to the methods.
可选的额外参数的方法。
类的对象----------Objects from the Class----------
Objects can be created by calls of the form new("dCHMsuper", ...) but are more commonly created via Cholesky(), applied to dsCMatrix or lsCMatrix objects.
对象可以通过电话的形式new("dCHMsuper", ...)但较为普遍,通过Cholesky()创建dsCMatrix或lsCMatrix对象。
插槽----------Slots----------
of "CHMfactor" and all classes inheriting from it:
"CHMfactor"“从它继承的所有类:
perm: An integer vector giving the 0-based permutation of the rows and columns chosen to reduce fill-in and
perm:一个整数向量,0选择,以减少填充的行和列的排列
colcount: Object of class "integer" ....
colcount:Object类的"integer"....
type: Object of class "integer" ....
type:Object类的"integer"....
Slots of the non virtual classes “[dl]CHM(super|simpl)”:
非虚拟课堂“[DL]中药(超| SIMPL)”的插槽:
p: Object of class "integer" of pointers, one for each column, to the initial (zero-based) index of elements in
p:Object类的"integer"指针,每列,初始(从零开始)元素的索引
i: Object of class "integer" of length nnzero (number of non-zero elements). These are the row numbers for each non-zero element in the matrix. Only present in classes that
i:Object类的"integer"长度nnzero的(非零元素的数目)。这些都是为每个矩阵中非零元素的行号。仅目前在类
x: For the "d*" classes: "numeric" - the
x:对于"d*"类"numeric" -
方法----------Methods----------
isLDL (x) returns a logical indicating if x is an LDL' decomposition or (when FALSE) an
isLDL(x)返回logical如果x是LDL'分解或(当FALSE)
coerce signature(from = "CHMfactor", to = "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
强制signature(from = "CHMfactor", to = "sparseMatrix")返回下三角因子LLL'Cholesky分解的形式的。请注意,(目前)从LL'形式的因素,总是返回,即使"CHMfactor"对象代表一个LDL'分解。此外,这是任何填充还原置换后已应用的因素。见expand获得两个置换矩阵方法,P,和较低的
coerce signature(from = "CHMfactor", to = "pMatrix") Returns the permutation matrix, P, representing the fill-reducing permutation used in the
要挟signature(from = "CHMfactor", to = "pMatrix")返回置换矩阵,P,代表填充在减少置换
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 corresponds to the product 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,
扩大signature(x = "CHMfactor")返回组件列表P,矩阵代表的减少填充置换,L,下三角的Cholesky因子。原正定矩阵对应产品P'LL'P。由于填写在分解产品可能显然有更多的非0比原来的矩阵后,即使申请drop0。然而,
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
图像signature(x = "CHMfactor")剧情图像的下三角因子,L分解。这种方法相当于image(as(x, "sparseMatrix"))所以在上面介绍的coerce方法的意见
solve signature(a = "CHMfactor", b = "ddenseMatrix") 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 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 <-
解决signature(a = "CHMfactor", b = "ddenseMatrix")solve的"CHMfactor"对象的方法需要一个可选的第三个参数system,其值可以是一个字符串"A","LDLt" ,"LD","DLt","L","Lt","D","P"或"Pt"。这种说法描述系统要解决的。默认情况下,"A",是解决Ax = bx其中A是稀疏,正定矩阵,分解产生a。类似地,system = "L"返回解决方案xLx = b,同样,为所有的系统代码,但"P"和"Pt"的地方,如中,<code> X < ; -
solve signature(a = "CHMfactor", b = "matrix"), and
解决signature(a = "CHMfactor", b = "matrix"),
solve signature(a = "CHMfactor", b = "numeric") call
解决signature(a = "CHMfactor", b = "numeric")致电
solve signature(a = "CHMfactor", b = "dsparseMatrix") takes the same third argument system and calls the
解决signature(a = "CHMfactor", b = "dsparseMatrix")相同的第三个参数system,并调用
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
行列式signature(x = "CHMfactor", logarithm = "logical")返回的决定因素(或对数行列式,如果logarithm = TRUE,默认)因素L的LL'分解(分解,即使代表x是LDL'形式(!))。这是行列式的平方根(行列式的对数的一半,当logarithm = TRUE)
update signature(object = "CHMfactor"). The update method requires an additional argument parent, which is a "dsCMatrix" object with the same structure of nonzeros as the matrix that was decomposed to produce object, and 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 represented by parent 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
更新signature(object = "CHMfactor")。 update方法需要一个额外的参数parent,这是一个"dsCMatrix"对象与结构相同的非零元素的矩阵分解产生object,并提供一个可选参数mult,数字标。此方法更新objectA+mIA是parent和m是标为代表的矩阵mult分解的数值。因为只有数值更新此方法应该是速度比创建和分解A+mI。它的情况并不少见想,说,A+mIm的许多不同的值的决定因素。这种方法
参见----------See Also----------
Cholesky, also for examples; class dgCMatrix.
Cholesky,也为例子;类dgCMatrix。
举例----------Examples----------
## An example for the expand() method[#例如扩大()方法]
n <- 1000; m <- 200; nnz <- 2000
set.seed(1)
M1 <- spMatrix(n, m,
i = sample(n, nnz, replace = TRUE),
j = sample(m, nnz, replace = TRUE),
x = round(rnorm(nnz),1))
XX <- crossprod(M1)
CX <- Cholesky(XX)
isLDL(CX)
str(CX) ## a "dCHMsimpl" object[#“dCHMsimpl的”对象]
r <- expand(CX)
L.P <- with(r, crossprod(L,P)) ## == L'P[#==欧莱雅带够]
PLLP <- crossprod(L.P) ## == (L'P)' L'P == P'LL'P[#==(“P级)”L带够== PLLP]
b <- sample(m)
stopifnot(all.equal(PLLP, XX),
all(as.vector(solve(CX, b, system="P" )) == r$P %*% b),
all(as.vector(solve(CX, b, system="Pt")) == t(r$P) %*% b) )
## [ See help(Cholesky) for more examples ][#[查看更多的例子帮助(乔列斯基)]]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|