Learn R Programming

TRES (version 1.1.1)

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(x, y, u, method=c('standard', 'FG', '1D', 'ECD', 'PLS'), Gamma_init)

Arguments

x

The predictor matrix of dimension \(p \times n\). Vector of length \(n\) is acceptable. If y is missing, x should be a list or an environment consisting of predictor and response datasets.

y

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.

  • "standard": The standard OLS type estimation.

  • "FG": Envelope estimation with full Grassmannian (FG) algorithm.

  • "1D": Envelope estimation with one dimensional optimization approaches by 1D algorithm.

  • "ECD": Envelope estimation with one dimensional optimization approaches by ECD algorithm.

  • "PLS": The SIMPLS-type estimation without manifold optimization.

Gamma_init

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

Value

x

The original predictor dataset.

y

The original response dataset.

call

The method call.

method

The method used.

coefficients

The estimation of regression coefficient tensor.

Gamma

The estimation of envelope subspace basis.

Sigma

A lists of estimated covariance matrices at each mode for the error term.

fitted.values

The fitted response tensor.

residuals

The residuals tensor.

Details

Please refer to Details of TRR_sim about the description of the tensor response regression model.

References

Li L, Zhang X (2017). <U+201C>Parsimonious Tensor Response Regression.<U+201D> Journal of the American Statistical Association, 112(519), 1131<U+2013>1146.

See Also

summary.Tenv for summaries, calculating mean squared error from the prediction.

plot.Tenv(via graphics::image) for drawing the two-dimensional coefficient plot and \(p\)-value plot.

predict.Tenv for prediction.

The generic functions coef, residuals, fitted.

TensEnv_dim for selecting the dimension of envelope by information criteria.

TRR_sim for generating the simulated data used in tensor response regression.

The simulated data bat used in tensor response regression.

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 TRR_sim.
dat <- TRR_sim(r = r, p = p, u = u, n = n)
x <- dat$x
y <- dat$y
B <- dat$coefficients

fit_std <- TRR.fit(x, y, method="standard")
fit_fg <- TRR.fit(x, y, u, method="FG")
fit_1D <- TRR.fit(x, y, u, method="1D")
fit_pls <- TRR.fit(x, y, u, method="PLS")
fit_ECD <- TRR.fit(x, y, u, method="ECD")

rTensor::fnorm(B-stats::coef(fit_std))
rTensor::fnorm(B-stats::coef(fit_fg))
rTensor::fnorm(B-stats::coef(fit_1D))
rTensor::fnorm(B-stats::coef(fit_pls))
rTensor::fnorm(B-stats::coef(fit_ECD))

## ----------- Pass a list or an environment to x also works ------------- ##
# Pass a list to x
l <- dat[c("x", "y")]
fit_std_l <- TRR.fit(l, method="standard")

# Pass an environment to x
e <- new.env()
e$x <- dat$x
e$y <- dat$y
fit_std_e <- TRR.fit(e, method="standard")

## ----------- Use dataset "bat" included in the package ------------- ##
data("bat")
x <- bat$x
y <- bat$y
fit_std <- TRR.fit(x, y, method="standard")

# }

Run the code above in your browser using DataLab