adjten {catch} | R Documentation |
Adjusts tensor with respect to covariates to achieve a more accurate performance. Tensor depends on the covariates through a linear regression model. The function returns the coefficients of covariates in regression and adjusted tensor list for further classifier modeling. It estimates coefficients based on training data, and then adjusts training tensor. When testing data is provided, the function will automatically adjust testing data by learned coefficients as well.
adjten(x, z, y, testx = NULL, testz = NULL, is.centered = FALSE)
x |
Input tensor or matrix list of length N, where N is the number of observations. Each element of the list is a tensor or matrix. The order of tensor can be any integer not less than 2. |
z |
Input covariate matrix of dimension N*q, where q<N. Each row of |
y |
Class label vector of dimention N*1. For |
testx |
Input testing tensor or matrix list. Each element of the list is a test case. When |
testz |
Input testing covariate matrix with each row being an observation. |
is.centered |
Indicates whether the input tensor and covariates have already been centered by their within class mean or not. If |
The model CATCH assumes the linear relationship bewteen covariates and tensor as
\mathbf{X}=\boldsymbol{μ}_k+\boldsymbol{α}\overline{\times}_{M+1}\mathbf{Z}+\mathbf{E},
where \boldsymbol{α} is the matrix of estimated coefficient of covariates. The function removes the effects of covariates on response variable through tensor and obtain \mathbf{X}-\boldsymbol{α}\overline{\times}_{M+1}\mathbf{Z} as adjusted tensor to fit tensor discriminant analysis model.
In estimating \boldsymbol{α}, which is the alpha
in the package, adjten
first centers both tensor and covariates within their individual classes, then performs tensor response regression which regresses {\mathbf{X}} on {\mathbf{Z}}.
gamma |
The estimated coefficients of covariates to plug in classifier. |
xres |
Adjusted training tensor list \mathbf{X}-\boldsymbol{α}\overline{\times}_{M+1}\mathbf{Z} after adjusting for covariates. The effect of the covariate is removed. |
testxres |
Adjusted testing tensor list \mathbf{X}-\boldsymbol{α}\overline{\times}_{M+1}\mathbf{Z} after adjusting for covariates. The effect of the covariate is removed. |
Yuqing Pan, Qing Mai, Xin Zhang
Pan, Y., Mai, Q., and Zhang, X. (2018) Covariate-Adjusted Tensor Classification in High-Dimensions, arXiv:1805.04421.
n <- 20 p <- 4 k <- 2 nvars <- p*p*p x <- array(list(),n) vec_x <- matrix(rnorm(n*nvars),nrow=n,ncol=nvars) vec_x[1:10,] <- vec_x[1:10,]+2 z <- matrix(rnorm(n*2),nrow=n,ncol=2) z[1:10,] <- z[1:10,]+0.5 y <- c(rep(1,10),rep(2,10)) for (i in 1:n){ x[[i]] <- array(vec_x[i,],dim=c(p,p,p)) } obj <- adjten(x, z, y)