Defines functions step.g3ordered

Documented in step.g3ordered

# Comput the core g given the 3-way matrix x, and the matrices A,B and C
#      x   of dimensions I x J x K
#      A   of dimensions I x p
#      B   of dimensions J x q
#      C   of dimensions K x r
#      g   of dimensions p x q x r
Z <- param$Z
a <- param$a
b <- param$b
cc <- param$cc
p <- ncol(a)
q <- ncol(b)
r <- ncol(cc)
x <- param$x
x <- flatten(x)# dim(x) is I x (JxK)
#cat("sono dentro spep.g3\n")#print(dim(a))
ax <- t(a) %*% x# dim(ax) is p x (JxK)
#bc <- b %k% cc#bc de dimensions (J x  K) x (q x r)
g <- ax %*% bc# g de dimensions c(p,(q x r))
 Z <- t(a) %*%diag(sqrt(pii))%*% x%*%Kron(diag(sqrt(pj)),diag(sqrt(pk))) %*% bc
dim(g) <- c(p, q, r)
dim(Z) <- c(p, q, r)
param$g <- g
param$Z <- Z

Try the CA3variants package in your browser

Any scripts or data that you put into this service are public.

CA3variants documentation built on Aug. 1, 2019, 5:06 p.m.