找回密码
 注册
查看: 593|回复: 0

R语言 SparseM包 SparseM.solve()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 12:33:45 | 显示全部楼层 |阅读模式
SparseM.solve(SparseM)
SparseM.solve()所属R语言包:SparseM

                                        Linear Equation Solving for Sparse Matrices
                                         稀疏矩阵的线性方程组求解

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

chol performs a Cholesky decomposition of a symmetric positive definite sparse matrix x of class matrix.csr. <br> backsolve performs a triangular back-fitting to compute the solutions of a system of linear equations in one step. <br> backsolve and forwardsolve can also split the functionality of backsolve into two steps. <br> solve combines chol and backsolve and will compute the inverse of a matrix if the right-hand-side is missing.
chol进行Cholesky分解,对称正定稀疏矩阵x类matrix.csr。参考backsolve执行一个三角形的背面拟合计算线性方程组的系统的解决方案在一个步骤。参考backsolve和forwardsolve也可以分割的功能backsolve分为两个步骤。参考solve结合chol和backsolve和计算逆矩阵,,如果右手侧失踪。


用法----------Usage----------


chol(x, ...)
## S4 method for signature 'matrix.csr.chol'
backsolve(r, x, k = NULL, upper.tri = NULL,
          transpose = NULL, twice = TRUE, ...)
forwardsolve(l, x, k = ncol(l), upper.tri = FALSE, transpose = FALSE)
solve(a, b, ...)



参数----------Arguments----------

参数:a
symmetric positive definite matrix of class matrix.csr.
对称正定矩阵类matrix.csr。


参数:r
object of class matrix.csr.chol returned by the function chol.
类的对象matrix.csr.chol的功能chol返回。


参数:l
object of class matrix.csr.chol returned by the function chol.
类的对象matrix.csr.chol的功能chol返回。


参数:x,b
vector(regular matrix) of right-hand-side(s) of a system of linear equations.
向量(正规矩阵)的右手侧(s)的线性方程组的系统。


参数:k
inherited from the generic; not used here.
从一般的继承,这里没有使用。


参数:upper.tri
inherited from the generic; not used here.
从一般的继承,这里没有使用。


参数:transpose
inherited from the generic; not used here.
从一般的继承,这里没有使用。


参数:twice
Logical flag:  If true backsolve solves twice, see below.
逻辑标志:,如果真backsolve解决了两倍,见下文。


参数:...
further arguments passed to or from other methods.
进一步的参数传递给其他方法。


Details

详细信息----------Details----------

chol performs a Cholesky decomposition of a symmetric positive definite sparse matrix a of class matrix.csr using the block sparse Cholesky algorithm of Ng and Peyton (1993).  The structure of the resulting matrix.csr.chol object is relatively complicated.  If necessary it can be coerced back to a matrix.csr object as usual with as.matrix.csr. backsolve does triangular back-fitting to compute the solutions of a system of linear equations.  For systems of linear equations that only vary on the right-hand-side, the result from chol can be reused.  Contrary to the behavior of backsolve in base R, the default behavior of  backsolve(C,b) when C is a matrix.csr.chol object is to produce a solution to the system Ax = b where C <- chol(A), see the example section.  When the flag twice is FALSE then backsolve solves the system Cx = b, up to a permutation  &ndash; see the comments below. The command solve combines chol and backsolve, and will compute the inverse of a matrix if the right-hand-side is missing. The determinant of the Cholesky factor is returned providing a means to efficiently compute the determinant of sparse positive definite symmetric matrices.
chol一个对称正定稀疏矩阵进行Cholesky分解a类matrix.csr使用的块稀疏的Cholesky算法吴和佩顿(1993年)。所得matrix.csr.chol对象的结构较为复杂。如果必要的话,它可以强制一个matrix.csr像往常一样as.matrix.csr的对象。 backsolve三角形背嵌合计算的线性方程系统的解决方案的。对于系统的线性方程组的右手侧,唯一不同的结果chol可重复使用。相反的行为backsolve的默认行为为基数R,backsolve(C,b)C是一个matrix.csr.chol对象是生产系统的解决方案Ax = b其中<X >,请参阅示例“部分。当标志C <- chol(A)是twice然后backsolve解决了系统FALSE,一个置换 - 看下面的评论。命令Cx = b结合solve和chol,并会计算逆矩阵,如果右手侧失踪。提供了一种有效地计算稀疏正定对称矩阵的行列式返回的Cholesky因子的决定性因素。


注意----------Note----------

Because the sparse Cholesky algorithm re-orders the positive definite sparse matrix A, the value of x <- backsolve(C, b) does not equal the solution to the triangular system Cx = b, but is instead the solution to the system CPx = Pb for some permutation matrix P (and analogously for x <- forwardsolve(C, b)).  However, a little algebra easily shows that backsolve(C, forwardsolve(C, b), twice = FALSE) is the solution to the equation Ax=b.  Finally, if C <- chol(A)  for some sparse covariance matrix A, and z is a conformable standard normal vector, then the product  y <- as.matrix.csr(C) %*% z is normal with covariance matrix A irrespective of the permutation of the Cholesky factor.
由于稀疏乔莱斯基算法重新排序的正定稀疏矩阵A的值x <- backsolve(C, b)不等于溶液的三角系统Cx = b,但代替到系统的解决方案CPx = Pb一些置换矩阵P(类似的x <- forwardsolve(C, b))。然而,一点点代数轻易地发现,backsolve(C, forwardsolve(C, b), twice = FALSE)是解决方程Ax=b。最后,如果C <- chol(A)一些稀疏的协方差矩阵A,和z是保形的标准的法线向量,然后将产物y <- as.matrix.csr(C) %*% z是正常与协方差矩阵A不论置换的的Cholesky因素。


参考文献----------References----------

http://www.econ.uiuc.edu/~roger/research
on advanced uniprocessor computers", SIAM J. Sci. Comput., 14, pp. 1034-1056.

参见----------See Also----------

slm for sparse version of lm <br>
slm稀疏版本的lm参考


实例----------Examples----------


data(lsq)
class(lsq) # -&gt; [1] "matrix.csc.hb"[ - > [1]“matrix.csc.hb”]
model.matrix(lsq)->design.o
class(design.o) # -&gt; "matrix.csr"[ - >“matrix.csr”]
dim(design.o) # -&gt; [1] 1850  712[ - > [1] 1850 712]
y &lt;- model.response(lsq) # extract the rhs[提取的RHS]
length(y) # [1] 1850[[1] 1850]

t(design.o) %*% design.o -> XpX
t(design.o) %*% y -> Xpy
chol(XpX) -> chol.o

b1 &lt;- backsolve(chol.o,Xpy) # least squares solutions in two steps[在两个步骤中的最小二乘解]
b2 &lt;- solve(XpX,Xpy)        # least squares estimates in one step[最小二乘估计一步到位]
b3 <- backsolve(chol.o, forwardsolve(chol.o, Xpy),
                twice = FALSE) # in three steps[在三个步骤]
## checking that these three are indeed equal :[#检查,这三个是相等的:]
stopifnot(all.equal(b1, b2), all.equal(b2, b3))

转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-6-10 11:50 , Processed in 0.027264 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表