rankMatrix(Matrix)
rankMatrix()所属R语言包:Matrix
Rank of a Matrix
矩阵的秩
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Compute the rank of matrix, a well-defined functional in theory, somewhat ambigous in practice. We provide several methods, the default corresponding to Matlab's definition.
计算排名基质,在理论上定义的功能,在实践中有所ambigous。我们提供几种方法,默认对应的Matlab的定义。
用法----------Usage----------
rankMatrix(x, tol = NULL,
method = c("tolNorm2", "qrLINPACK", "useGrad", "maybeGrad"),
sval = svd(x, 0, 0)$d)
参数----------Arguments----------
参数:x
numeric matrix, of dimension n x m, say.
数字矩阵,维n x m,说。
参数:tol
nonnegative number specifying a tolerance for “practically zero” with specific meaning depending on method; by default, max(dim(x)) * .Machine$double.eps * abs(max(sval)) is according to Matlab's default (for its only method "tolNorm2").
非负数指定为“几乎为零”的具体含义取决于宽容method;默认情况下,max(dim(x)) * .Machine$double.eps * abs(max(sval))根据Matlab的默认(其唯一的method“tolNorm2”)。
参数:method
a character string specifying the computational method, can be abbreviated:
一个字符串指定的计算方法,可以缩写:
tolNorm2the number of singular values >= tol;
数奇异值tolNorm2the的>= tol;
qrLINPACKthis is the rank of qr(x, tol, LAPACK=FALSE), which is qr(...)$rank for a dense matrix, and the rank of R for sparse x (where qr uses a "sparseQR" method, see qr-methods, and not LINPACK). This used to be the recommended way to compute a matrix rank for a while in the past. For this method, sval are not used (nor computed).
qrLINPACKthis是qr(x, tol, LAPACK=FALSE)是qr(...)$rank密集的矩阵,R稀疏x(其中qr使用“排名排名sparseQR“的方法,请参阅qr-methods,而不是LINPACK性能)。这是推荐的方法来计算在过去一段时间的矩阵秩。对于这种方法,sval不使用(不计算)。
useGradconsidering the “gradient” of the (decreasing) singular values, the index of the smallest gap.
useGradconsidering“梯度”的奇异值(减少),指数的差距最小。
maybeGradchoosing method "useGrad" only when that seems reasonable; otherwise using "tolNorm2".
maybeGradchoosing方法"useGrad"只有当这似乎是合理的,否则使用"tolNorm2"。
参数:sval
numeric vector of non-increasing singular values of x; typically unspecified and computed from x.
增加x非奇异值通常不明,从x计算的数字向量。
值----------Value----------
positive integer in 1:min(dim(x)), with attributes detailing the method used.
在1:min(dim(x))正整数,详细说明使用的方法属性。
作者(S)----------Author(s)----------
Martin Maechler; for the "*Grad" methods, building on
suggestions by Ravi Varadhan.
参见----------See Also----------
qr, svd.
qr,svd。
举例----------Examples----------
rankMatrix(cbind(1, 0, 1:3)) # 2[2]
(meths <- eval(formals(rankMatrix)$method))
## a "border" case:[#一个“边界”的情况:]
H12 <- Hilbert(12)
rankMatrix(H12, tol = 1e-20) # 12; but 11 with default method & tol.[12,但默认方法及TOL 11。]
sapply(meths, function(.m.) rankMatrix(H12, method = .m.))
## tolNorm2 qrLINPACK useGrad maybeGrad[#tolNorm2 qrLINPACK useGrad maybeGrad]
## 11 12 11 11[#11 12 11 11]
## "sparse" case:[#“稀疏”的情况:]
M15 <- kronecker(diag(x=c(100,1,10)), Hilbert(5))
sapply(meths, function(.m.) rankMatrix(M15, method = .m.))
#--> all 15, but 'useGrad' has 14.[ - >所有15个,但“useGrad有14个。]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|