Description Usage Arguments Value References Examples
Main function for fitting the nonparametric trace regression. The algorithm uses a learning reduction approach to estimate the nonparametric trace regression via ASSIST.
1 | TraceAssist(X,y,X_new=NULL,r,sparse_r,sparse_c,H=10,lambda=0,rho.ini=0.1,min,max)
|
X |
A list of matrix-valued predictors. |
y |
A vector of response variables. |
X_new |
A list of new matrices in the test data. |
r |
The rank of sign representable function to be fitted. |
sparse_r |
The number of zero rows in coefficient matrix. |
sparse_c |
The number of zero columns in coefficient matrix. |
H |
Resoution parameter that controls the number of classifiers to aggregate. |
lambda |
Lagrangian multiplier. |
rho.ini |
Initial step size. |
min |
Minimum value of the response variables |
max |
Maximum value of the response variables. |
The returned object is a list of components.
B_est
- An array that collects a series of coefficient matrices for the classifiers used in the algorithm.
fitted
- The predicted responses in the test data.
sign_fitted
- A matrix that collects a series of predicted signs for the classifiers used in the algorithm.
Lee, C., Li, L., Zhang, H., and Wang, M. (2021). Nonparametric Trace Regression via Sign Series Representation. arXiv preprint arXiv:2105.01783.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 | ######### Generate matrices in the training data ################
X = list()
for(i in 1:10){
X[[i]] = matrix(runif(4,-1,1),nrow = 2,ncol = 2)
}
######### Generate coefficient matrix ###########################
B = runif(2,-1,1)%*%t(runif(2,-1,1))
######### Generate response variables ###########################
y = NULL;signal = NULL
for(i in 1:10){
signal = c(signal,sum(X[[i]]*B))
y = c(y,sum(X[[i]]*B)+rnorm(1,sd = 0.1))
}
######### Run ASSIST ############################################
res =TraceAssist(X,y,r = 1,sparse_r = 0,sparse_c = 0,min = min(y),max = max(y))
mean(abs(res$fitted-signal))
######### Generate new matrices in the test data ################
X_new = list()
for(i in 1:10){
X_new[[i]] = matrix(runif(4,-1,1),nrow = 2,ncol = 2)
}
######### Generate response variables from X_new ################
y_new = NULL
for(i in 1:10){
y_new = c(y_new,sum(X_new[[i]]*B))
}
######### Run ASSIST #############################################
res =TraceAssist(X,y,X_new,r = 1,sparse_r = 0,sparse_c = 0,min = min(y),max = max(y))
mean(abs(res$fitted-y_new))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.