block.mult(SpatioTemporal)
block.mult()所属R语言包:SpatioTemporal
Multiplication of Block Diagonal Matrix and Vector
分块对角矩阵和向量的乘法
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Computes the matrix product between a block diagonal square matrix and a column vector (or matrix).
计算块之间的对角方矩阵的列向量(或矩阵)的矩阵乘积。
用法----------Usage----------
block.mult(mat, X, n.x = dim(X)[2], n.blocks = 1, block.sizes =
rep(dim(mat)[1]/n.blocks, n.blocks))
参数----------Arguments----------
参数:mat
A block diagonal, square matrix.
块对角方阵。
参数:X
Vector or matrix to multiply by mat.
向量或矩阵乘以mat。
参数:n.x
Number of columns in X, defaults correctly if X is a matrix.
数列在正确的话X,默认X是一个矩阵。
参数:n.blocks
Number of diagonal blocks in mat. Defaults to 1 (i.e. a full matrix) if not given.
数的对角线块mat。如果没有给出,默认为1(即一个完整的矩阵)。
参数:block.sizes
A vector of length n.blocks with the size of each of the diagonal blocks. If not given it will assume equal-sized blocks.
的向量的长度n.blocks与每个对角块的大小。如果没有给定将承担同等大小的块,。
值----------Value----------
Returns mat * X.
返回垫* X.
(作者)----------Author(s)----------
Johan Lindstr枚m
参见----------See Also----------
Block matrices van be created by make.sigma.B, make.sigma.B.full and <br> make.sigma.nu.
分块矩阵被创建make.sigma.B,make.sigma.B.full和<br>make.sigma.nu。
Other block matrix functions makeCholBlock, calc.iS.X, calc.tF.times.mat, <br> dot.prod, sumLogDiag.
其他分块矩阵的功能makeCholBlock,calc.iS.X,calc.tF.times.mat,参考dot.prod,sumLogDiag。
This function is called by loglike.
此功能被称为loglike。
实例----------Examples----------
#create a matrix[创建一个矩阵]
mat <- cbind(c(1,0,0),c(0,2,1),c(0,1,2))
#define the number of blocks and block sizes[定义的块大小和块的数目]
block.sizes <- c(1,2)
n.blocks <- length(block.sizes)
#define a X vector[定义一个X向量]
X <- c(1,2,3)
#compute mat %*% X[计算垫%*%X]
block.mult(mat, X, n.x = 1, n.blocks, block.sizes)
#or the old fashioned way[或老式的方法]
mat %*% X
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|