bdiag(spam)
bdiag()所属R语言包:spam
Binds Arrays Corner-to-Corner
绑定阵列角角
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Creates a sparse block-diagonal matrix.
创建一个稀疏的块对角矩阵。
用法----------Usage----------
bdiag.spam(...)
参数----------Arguments----------
参数:...
Arrays to be binded together
数组绑定在一起
Details
详细信息----------Details----------
This is a small helper function to create block diagonal sparse matrices. In the two matrix case, bdiag.spam(A,B), this is equivalent to a complicated rbind(cbind(A, null), cbind(B, t(null))), where null is a null matrix of appropriate dimension.<br>
这是一个小的辅助函数来创建块对角稀疏矩阵。在这两个矩阵的情况下,bdiag.spam(A,B),这是相当于一个复杂的rbind(cbind(A, null), cbind(B, t(null))),null是一个空矩阵适当的尺寸。<BR>
It is recursively defined.
这是递归定义的。
The arrays are coerced to sparse matrices first.<br>
数组是先强制转换为稀疏矩阵。参考
This function is similar to the function bdiag from the package Matrix. It is also similar to the function adiag from the package magic. However, here no padding is done and all the dimnames are stripped.
此功能是类似的功能bdiag从包Matrix。这也是类似的功能adiag从包magic。然而,这里没有填充完成,所有的dimnames被剥夺。
值----------Value----------
Returns a spam matrix as described above.
返回一个spam如上所述矩阵。
(作者)----------Author(s)----------
Reinhard Furrer
参见----------See Also----------
diag.spam.
diag.spam。
实例----------Examples----------
A <- diag.spam(2, 4) # 2*I4[2 * I4]
B <- matrix(1,3,3)
AB <- bdiag.spam(A,B)
# equivalent to:[等效于:]
ABalt <- rbind(cbind( A, matrix(0,nrow(A),ncol(B))),
cbind( matrix(0,nrow(B),ncol(A)), B))
norm(AB-ABalt)
# Matrices do not need to be square:[矩阵不需要是正方形:]
bdiag.spam(1,2:5,6)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|