Learn R Programming

TRES (version 1.1.0)

TRR.fit: Tensor response regression

Description

This function is used for estimation of tensor response regression. The available method including standard OLS type estimation, PLS type of estimation as well as envelope estimation with FG, 1D and ECD approaches.

Usage

TRR.fit(Xn, Yn, method=c('standard', 'FG', '1D', 'ECD', 'PLS'),
    u=NULL, Gamma_init=NULL)

Arguments

Xn

The predictor matrix of dimension \(p \times n\). Vector of length \(n\) is acceptable.

Yn

The response tensor instance with dimension \(r_1\times r_2\times\cdots\times r_m \times n\), where \(n\) is the sample size. Array with the same dimensions and matrix with dimension \(r\times n\) are acceptable.

u

The dimension of envelope subspace. \(u=(u_1,\cdots, u_m)\). Used for methods "FG", "1D", "ECD" and "PLS". User can use TensEnv_dim to select dimension.

method

The method used for estimation of tensor response regression. There are four possible choices.

Gamma_init

A list specifying the initial envelope subspace basis for "FG" method. If unspecified, use the estimation from "1D" algorithm.

Value

Xn

The input predictor matrix.

Yn

The input response tensor.

method

The method used.

coefficients

The estimation of regression coefficient tensor.

Gamma

The estimation of envelope subspace basis.

Sig

A matrix lists of \(\boldsymbol{\Sigma}_k\), where \(\boldsymbol{\Sigma}=\boldsymbol{\Sigma}_m \otimes \cdots \otimes \boldsymbol{\Sigma}_1\).

fitted.values

The fitted response tensor.

residuals

The residuals tensor.

See Also

plot.Tenv, predict.Tenv, vcov.Tenv, summary.Tenv, TensEnv_dim, TRR_sim.

Examples

Run this code
# NOT RUN {
rm(list=ls())

# The dimension of response
r <- c(10, 10, 10)
# The envelope dimensions u.
u <- c(2, 2, 2)
# The dimension of predictor
p <- 5
# The sample size
n <- 100

# Simulate the data with \code{\link{TRR_sim}}.
dat <- TRR_sim(r = r, p = p, u = u, n = n)
Xn <- dat$Xn
Yn <- dat$Yn
B <- dat$coefficients

res_std <- TRR.fit(Xn, Yn, method="standard")
res_fg <- TRR.fit(Xn, Yn, u, method="FG")
res_1D <- TRR.fit(Xn, Yn, u, method="1D")
res_pls <- TRR.fit(Xn, Yn, u, method="PLS")
res_ECD <- TRR.fit(Xn, Yn, u, method="ECD")

rTensor::fnorm(B-stats::coef(res_std))
rTensor::fnorm(B-stats::coef(res_fg))
rTensor::fnorm(B-stats::coef(res_1D))
rTensor::fnorm(B-stats::coef(res_pls))
rTensor::fnorm(B-stats::coef(res_ECD))

## Use dataset bat
data("bat")
Xn <- bat$Xn
Yn <- bat$Yn
res_std <- TRR.fit(Xn, Yn, method="standard")
# }

Run the code above in your browser using DataLab