ordering(spam)
ordering()所属R语言包:spam
Extract the permutation
提取物置换
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Extract the (inverse) permutation used by the Cholesky
提取(逆)置换所使用的Cholesky
用法----------Usage----------
ordering( x, inv=FALSE)
参数----------Arguments----------
参数:x
object of class spam.chol.method returned by the function chol.
对象类spam.chol.方法返回的功能chol。
参数:inv
Return the permutation (default) or inverse thereof.
返回其排列(默认)或逆。
Details
详细信息----------Details----------
Recall that calculating a Cholesky factor from a sparse matrix consists of finding a permutation first, then calculating the factors of the permuted matrix. The ordering is important when working with the factors themselves.<br>
回想一下,从一个稀疏矩阵计算Cholesky因子包括找到一个置换,然后再置换后的矩阵计算的因素。顺序是很重要的工作时,<BR>的因素。
The ordering from a full/regular matrix is 1:n.<br>
从全/定期矩阵的顺序是1:n。<BR>
Note that there exists many different algorithms to find orderings. <br>
请注意,存在许多不同的算法来找到排序。参考
See the examples, they speak more than 10 lines.
参考下面的例子,他们说超过10行。
(作者)----------Author(s)----------
Reinhard Furrer
参见----------See Also----------
chol, solve.
chol,solve。
实例----------Examples----------
# Construct a pd matrix S to work with (size n)[构建一个PD矩阵S的工作(大小为n)]
n <- 100 # dimension[尺寸]
S <- .25^abs(outer(1:n,1:n,"-"))
S <- as.spam( S, eps=1e-4)
I <- diag(n) # Identity matrix[单位矩阵]
cholS <- chol( S)
ord <- ordering(cholS)
iord <- ordering(cholS, inv=TRUE)
R <- as.spam( cholS ) # R'R = P S P', with P=I[ord,],[RR = P S P,P = I [条例]]
# a permutation matrix (rows permuted).[置换矩阵(行置换)。]
RtR <- t(R) %*% R
# the following are equivalent:[以下是等效的:]
as.spam( RtR - S[ord,ord] )
as.spam( RtR[iord,iord] - S )
as.spam( t(R[,iord]) %*% R[,iord] - S )
# trivially:[平凡:]
as.spam( t(I[iord,]) - I[ord,]) # (P^-1)' = P [(P ^ -1)= P]
as.spam( t(I[ord,]) - I[,ord]) # []
as.spam( I[iord,] - I[,ord])
as.spam( I[ord,]%*%S%*%I[,ord] - S[ord,ord] )
# pre and post multiplication with P and P' is ordering[P和P的前处理和后乘法订货]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|