| catch_matrix {catch} | R Documentation | 
Fit a CATCH model for matrix and predict categorical response.
Description
Fits a classifier for matrix data. catch_matrix is a special case of catch when each observation \mathbf{X}_i is a matrix. Different from catch takes list as input, data need to be formed in an array to call the function (see arguments). The function will perform prediction as well.
Usage
catch_matrix(x, z = NULL, y, testx = NULL, testz = NULL, ...)
Arguments
x | 
 Input matrix array. The array should be organized with dimension   | 
z | 
 Input covariate matrix of dimension   | 
y | 
 Class label. For   | 
testx | 
 Input testing matrix array. When   | 
testz | 
 Input testing covariate matrix. Can be omitted if there is no covariate.  | 
... | 
 Other arguments that can be passed to   | 
Details
The function fits a matrix classifier as a special case of catch. The fitted model and predictions should be identical to catch when matrix data is provided. Input matrix should be organized as three-way array where sample size is the last dimension. If the matrix is organized in a list, users can either reorganize it or use catch directly to fit model, which takes a matrix or tensor list as input and has the same output as catch_matrix.
Value
beta | 
 Output variable coefficients for each   | 
df | 
 The number of nonzero variables for each value in sequence   | 
dim | 
 Dimension of coefficient array.  | 
lambda | 
 The actual   | 
obj | 
 Objective function value for each value in sequence   | 
x | 
 The matrix list after adjustment in training data. If covariate is absent, this is the original input matrix.  | 
y | 
 Class label in training data.  | 
npasses | 
 Total number of iterations.  | 
jerr | 
 Error flag.  | 
sigma | 
 Estimated covariance matrix on each mode.   | 
delta | 
 Estimated delta matrix   | 
mu | 
 Estimated mean array.  | 
prior | 
 Prior proportion of observations in each class.  | 
call | 
 The call that produces this object.  | 
pred | 
 Predicted categorical response for each value in sequence   | 
Author(s)
Yuqing Pan, Qing Mai, Xin Zhang
References
Pan, Y., Mai, Q., and Zhang, X. (2018) Covariate-Adjusted Tensor Classification in High-Dimensions, arXiv:1805.04421.
See Also
Examples
#without prediction
n <- 20
p <- 4
k <- 2
nvars <- p*p
x=array(rnorm(n*nvars),dim=c(p,p,n))
x[,,11:20]=x[,,11:20]+0.3
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))
obj <- catch_matrix(x,z,y=y)