Learn R Programming

TRES (version 1.1.1)

PMSE: Predictions and Mean squared error for tensor predictor regression (TPR).

Description

Evaluate tensor predictor regression through prediction mean squared error.

Usage

PMSE(x, y, Bhat)

Arguments

x

A predictor tensor of dimension \(p_1\times p_2\times\cdots\times p_m \times n\), where \(n\) is the sample size. Matrix and array are also allowed.

y

A response matrix of dimension \(r \times n\), where \(n\) is the sample size. Vector is also allowed.

Bhat

An estimation of coefficient tensor of dimension \(p_1\times p_2\times\cdots\times p_m \times r\). Vector, matrix and array are also allowed as long as the dimensions match the ones of x and y.

Value

mse

Mean squared error. Defined as \(1/n\sum_{i=1}^n\|\mathbf{Y}_i-\hat{\mathbf{Y}}_i\|_F^2\), where \(\hat{\mathbf{Y}}_i\) is the prediction and \(\|\cdot\|_F\) is the Frobenius norm of tensor.

pred

The predictions of tensor predictor regression.

See Also

TPR.fit, TPR_sim.

Examples

Run this code
# NOT RUN {
rm(list = ls())
# The dimension of predictor
p <- c(10, 10, 10)
# The envelope dimensions u.
u <- c(1, 1, 1)
# The dimension of response
r <- 5
# The sample size
n <- 200

# Simulate the data with \code{\link{TPR_sim}}.
dat <- TPR_sim(p = p, r = r, u = u, n = n)
x <- dat$x
y <- dat$y

fit_std <- TPR.fit(x, y, u, method="standard")
result <- PMSE(x, y, fit_std$coefficients)
# }

Run the code above in your browser using DataLab