R/tgJADERotate.R

Defines functions tgJADERotate

tgJADERotate <-
function(x, lags, maxiter, eps){
  r <- length(dim(x)) - 1
  
  rotateStack <- vector("list", r)
  for(m in 1:r){
    pm <- dim(x)[m]
    lagStack <- NULL
    for(l in 1:length(lags)){
      for(i in 1:pm){
        for(j in 1:pm){
          lagStack <- rbind(lagStack, mModeTGJADEMatrix(x, m, i, j, lags[l], pm))
        }
      }
    }
    rotateStack[[m]] <- t(frjd(lagStack, maxiter=maxiter, eps=eps)$V)
  }
  
  
  for(m in 1:r){
    x <- tensorTransform(x, rotateStack[[m]], m)
  }
  
  return(list(x = x, U = rotateStack))
}

Try the tensorBSS package in your browser

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

tensorBSS documentation built on June 2, 2021, 9:08 a.m.