iProcrustes(flowStats)
iProcrustes()所属R语言包:flowStats
Procrustes analysis. Using singular value decomposition (SVD) to determine a linear transformation to align the points in X to the points in a reference matrix Y.
Procrustes分析。利用奇异值分解(SVD),以确定一个线性变换,在参考矩阵Y.点对准在X点
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Based on generalized Procrustes analysis, this function determines a linear transformation (rotation/reflection and scalling) of the points in matrix x to align them to their reference points in matrix xbar. The alignemnt is carried out by minimizing the distance between the points in x and xbar.
这个函数广义Procrustes分析的基础上,决定在矩阵x一个点的线性变换(旋转/反射和scalling)对齐矩阵xbar他们的参考点。在alignemnt进行了减少之间x和xbar点的距离。
用法----------Usage----------
iProcrustes(x, xbar, rotation.only=TRUE, scalling=TRUE, translate=FALSE)
参数----------Arguments----------
参数:x
A numerical matrix to be align to points in xbar, the second arguement. The columns represents the coordinates of the points. The matrices x and xbar must have the same dimensions.
一个数值矩阵是对准点xbar,第二arguement的。列代表点的坐标。矩阵x和xbar必须具有相同的尺寸。
参数:xbar
A numerical, reference matrix to which points in matrix x are to be aligned.
一个数值,参考矩阵,在矩阵指向x要对齐。
参数:rotation.only
Logical. When rotaion.only is TRUE, it allows the function to lose reflection component of the linear transformation. Although it might not give the best-fitting aligenment, when dealing with flow cytometry data alignment, a non-reflection transformation is prefered. When rotaion.only is FALSE, it allows the function to retain the reflection component.
逻辑。当rotaion.only为TRUE,它允许的功能失去反射的线性变换的组成部分。虽然它可能不会给最佳拟合aligenment,用流式单元仪数据对齐打交道时,优先改造非反射。当rotaion.only是假的,它允许保留的反射组件的功能。
参数:scalling
Logical. When scalling is FALSE, it allows the function to calculate the linear transformation without a scalling factor. That is, the returning scalling factor is set to 1.
逻辑。当scalling是假的,它允许函数计算没有scalling因素的线性变换。也就是说,返回scalling因子设置为1。
参数:translate
Logical. Set translate to FALSE when the points in matrices x and xbar are already centralized prior to applying this function. When translate is TRUE, it allows the function to translate the centroid the points in matrix x to that of points in xbar.
逻辑。设置了translate为FALSE时,在x和XBAR矩阵点已经集中到应用此功能前。当translate为TRUE,它允许函数翻译的重心点矩阵x在xbar点。
Details
详情----------Details----------
Suppose the points in matrix X and \bar{X} are centralized (meaning their centroids are at the origin). The linear transformation of X for aligning X to its reference matrix \bar{X}., i.e., min ||sXQ - \bar{X}||_F, is given by:
假设在点矩阵X和\bar{X}都集中(这意味着他们的质心在原点)。对准X其参考矩阵X,即\bar{X}。线性变换,分钟||sXQ - \bar{X}||_F,是由:
and
和
where V and U are the sigular value vectors of \bar{X}^T X (that is, \bar{X}^T X = U Σ V^T), and s is the scalling factor.
V和U的奇异值向量\bar{X}^T X(即\bar{X}^T X = U Σ V^T),s是scalling的因素。
值----------Value----------
A list of the linear tranformation with items
与项目的直线穿越 - 名单
参数:Q
An orthogonal, rotation/reflection matrix.
正交旋转/反射矩阵。
参数:scal
A scalling factor </table>
一个标度因数</ TABLE>
.
。
参数:T
(optional) A translation vector used to shift the centroid of the points in matrix x to the origin. Returned when translate is TRUE.
(可选)翻译向量用于转移矩阵x点的重心原点。返回时translate为TRUE。
参数:T.xbar
(optional) Centered xbar (that is, the centroid of the points in xbar is translated to the origin). Returned when translate is TRUE.
(可选)中心xbar(即xbar翻译的起源点的重心)。返回时translate为TRUE。
Note that the return values of this function do not include the transformed matrix scal* x* Q or scal*(x-IT)*Q, where T is the translation vector and I is an n-by-1 vector with elements 1.
请注意,这个函数的返回值不包括转换矩阵scal* x* Q或scal*(x-IT)*Q,其中T是平移向量和I是n-by-1向量元素1。
作者(S)----------Author(s)----------
C. J. Wong <a href="mailto:cwon2@fhcrc.org">cwon2@fhcrc.org</a>
参见----------See Also----------
gpaSet
gpaSet
举例----------Examples----------
## Example 1 [#示例1]
x <- matrix(runif(20), nrow=10, ncol=2)+ 1.4
s <- matrix(c(cos(60), -sin(60), sin(60), cos(60)),
nrow=2, ncol=2, byrow=TRUE)
xbar <- 2.2 *(x %*% s) - 0.1
lt <- iProcrustes(x, xbar, translate=TRUE) ## return linear transformation[#返回线性变换]
lt
## showing result[#显示结果]
I <- matrix(1, nrow=nrow(x), ncol=1)
tx <- x - I %*% lt$T
## get the transformed matrix xnew[#得到的转换矩阵xnew]
xnew <- lt$scal * (tx %*% lt$Q)
if (require(lattice)) {
xyplot(V1 ~ V2,
do.call(make.groups, lapply(list(x=x, xbar=xbar, T.xbar=lt$T.xbar,
xnew=xnew),as.data.frame)),
group=which, aspect=c(0.7), pch=c(1,3,2,4), col.symbol="black",
main=("Align the points in x to xbar"),
key=list(points=list(pch=c(1,3,2,4), col="black"), space="right",
text=list(c("x", "xbar", "T.xbar", "xnew"))))
}
## Example 2. centralized x and xbar prior to using iProcrustes[#示例2。集中x和XBAR前使用iProcrustes的]
x <- matrix(runif(10), nrow=5, ncol=2)
s <- matrix(c(cos(60), -sin(60), sin(60), cos(60)),
nrow=2, ncol=2, byrow=TRUE)
xbar <- 1.2 *(x %*% s) - 2
I <- matrix(1, nrow=nrow(x), ncol=1)
x <- x-(I %*% colMeans(x)) ## shift the centroid of points in x to the origin[#在x点的重心转移到原点]
xbar <- xbar - (I %*% colMeans(xbar)) ## shift centroid to the origin[#转移重心到原点]
lt <- iProcrustes(x, xbar, translate=FALSE) ## return linear transformation[#返回线性变换]
## only return the rotation/reflection matrix and scalling factor[#只返回旋转/反射矩阵和标度因子]
lt
xnew=lt$scal *(x %*% lt$Q) ## transformed matrix aligned to centralized xbar[#转换矩阵对齐集中XBAR]
if (require(lattice)) {
xyplot(V1 ~ V2,
do.call(make.groups, lapply(list(x=x,xbar=xbar,
xnew=xnew), as.data.frame)),
group=which, auto.key=list(space="right"))
}
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|