procotWeW {lazy.procrustes}R Documentation

Weighted Expanded Orthogonal Procrustes Rotation
The Ultimate Model

Description

Weighted Expanded Orthogonal Procrustes Rotation
The Ultimate Model

Usage

procotWeW(
  A,
  C,
  V,
  estm = 0,
  estT = 1,
  estW = 0,
  estW2 = 0,
  W = NULL,
  T = NULL,
  m = NULL,
  W2 = NULL,
  maxiter = 200,
  eps = 1e-06,
  maxiter2 = 20,
  eps2 = 1e-06,
  print = 2
)

Arguments

A

The input matrix to be rotated

C

The target matrix

V

The weight matrix (known)

estm

= 1 to estimate m

estT

= 0 to avoid estimation of T

estW

= 1 to estimate scalar W
= 2 to estimate diagonal W matrix

estW2

= 1 to estimate diagonal W2 matrix

W

Initial value of W or NULL

T

Initial value of T or NULL

m

Initial value of m or NULL

W2

Initial value of W2 or NULL

maxiter

max # of iterations

eps

convergence criterion for rmse

maxiter2

max # of iterations for procotWKS

eps2

convergence criterion for procotWKS

print

= 1 to print result

Details

This program finds those A, m, W, W2 and orthonormal T which minimize
RSS = tr( ( C - Chat ) V ( C - Chat )' )
where Chat = A %*% W %*% T %*% W2 + matrix(1,nv) %*% t(m), W and W2 are diagonal matrices, T is an orthonormal rotation matrix,
m is the column mean vector.

Note that when estW=0, estW2=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=A %*% W %*% T + matrix(1,nv,1)%*%t(m), T, m, W, W2 , Cm the updated target matrix, rmse=sqrt(RSS)

Examples

 seed <- 1701; n <- 20; nr <- 2; pmiss <- 0; errstd <- 0.05
 set.seed(seed)
 resg <- gendataWmm( 1, n, nr, genm=1, genW=2, genW2=1, genV=1
                   , pmiss=pmiss, errstd=errstd )
 A <- resg$A; V <- resg$V
 C <- resg$C; Tg <- resg$T; mg <- resg$m; Wg <- resg$W; W2g <- resg$W2
 res <- procotWeW( A, C, V, estm=1, estW=2, estW2=1, print=1 )
 T <- res$T; m <- res$m; W <- res$W; W2 <- res$W2
 Print( Tg-T, mg-m, fmt="7.3" )
 Print( Wg-W, W2g-W2, fmt="7.3" )


[Package lazy.procrustes version 0.1.4 Index]