TRES
The package TRES implements the least squares and envelope estimation under the framework of tensor regression models. The general model-free envelope models can also be flexibly handled by the package via three types of envelope estimation algorithms:
- Full Grassmannian (FG) algorithm.
- 1D algorithm.
- Envelope coordinate descent (ECD) algorithm
- Partial least squares (PLS) type algorithm.
Installation
You can install the released version of TRES from CRAN with:
# Install devtools from CRAN
install.packages("TRES")
# Or the development version from GitHub:
devtools::install_github("jerryfsu3333/TRES")
Example
This is a basic example which shows you how to use function TRR.fit
in Tensor Response Regression (TRR) model with least square.
library(TRES)
## Load data "bat"
data("bat")
x <- bat$x
y <- bat$y
fit <- TRR.fit(x, y, method="standard")
## Print cofficient
coef(fit)
## Print the summary
summary(fit)
## Make the prediction on the original dataset
predict(fit, x)
## Draw the plot of two-way coefficient tensor (or matrix)
plot(fit)