| procote {lazy.tools} | R Documentation |
Extened Orthogonal Procrustes Rotation
Description
Extened Orthogonal Procrustes Rotation
Usage
procote(A, C, estm = 0, estd = 0, maxiter = 200, eps = 1e-06, print = 2)
Arguments
A |
The input matrix to be rotated |
C |
The target matrix |
estm |
= 1 to estimate column means |
estd |
= 1 to estimate scaling constant |
maxiter |
max # of iterations |
eps |
convergence criterion for rmse |
print |
= 0 to surpress the output |
Details
This program finds those A, m, d and orthonormal T which minimize
RSS = tr( ( C - Chat )' ( C - Chat ) )
where Chat = d * A \%*\% T + matrix(1,nv) \%*\% t(m),
d is a scalar, T is an orthonormal rotation matrix,
and m is the column mean vector.
Note that when estd=0 and estm=0
, and the target matrix does not
have missing elements,
this is equivalent to the usual orthogonal Procrustes rotation.
Value
A list of:
B=d * A %*% T + matrix(1,nv,1)%*%t(m),
T, m, d, Cm the updated target matrix, rmse=sqrt(RSS)
Examples
set.seed(1701)
nv <- 10; nr <- 2
pmiss <- 0.3
A <- matrix(rnorm(nv*nr),nv,nr)
dum <- matrix(rnorm(nv*nr),nv,nr)
T <- eigen(t(dum)%*%dum)[[2]]
m <- matrix(rnorm(nr),nr,1)
d <- 10*runif(1)
C <- d*A%*%T + matrix(rep(1,nv),nv,1)%*%t(m)
res <- procote( A, C, estm=0, estd=0, print=1 )
res2 <- procote( A, C, estm=1, estd=1, print=1 )
# missing elements in the target
dum <- matrix(runif(nv*nr),nv,nr)
C[which(dum < pmiss)] <- NA
res3 <- procote( A, C, estm=0, estd=0, print=1 )
res4 <- procote( A, C, estm=1, estd=1, print=1 )
[Package lazy.tools version 1.0.0.20260516 ]