sync: TSIR change
This commit is contained in:
parent
c4a93d25fa
commit
491688378c
|
@ -45,7 +45,7 @@ TSIR <- function(X, y,
|
|||
y <- as.integer(y)
|
||||
|
||||
# center `X`
|
||||
X <- X - c(rowMeans(X, dim = length(modes)))
|
||||
X <- X - as.vector(rowMeans(X, dim = length(modes)))
|
||||
|
||||
# Slice `X` into slices governed by `y`
|
||||
slices <- Map(function(s) {
|
||||
|
@ -119,7 +119,7 @@ TSIR <- function(X, y,
|
|||
}
|
||||
|
||||
# mode sample covariance matrices
|
||||
Omegas <- Map(function(k) n^-1 * mcrossprod(X, mode = k), modes)
|
||||
Omegas <- Map(function(k) prod(dim(X)[-k])^-1 * mcrossprod(X, mode = k), modes)
|
||||
|
||||
# Check condition of sample covariances and perform regularization if needed
|
||||
if (is.finite(cond.threshold)) {
|
||||
|
|
Loading…
Reference in New Issue