Learn R Programming

TensorMCMC (version 0.1.0)

predict_tensor_cpp: Predict Response Using Tensor Regression C++

Description

This function calls the underlying C++ function `predict_tensor_cpp` to compute predicted responses given a flattened tensor, low-rank coefficient matrices, and scalar covariate coefficients.

Usage

predict_tensor_cpp(X_vec, beta, gam, n, p, d, rank)

Value

Numeric vector of length n

Arguments

X_vec

Flattened tensor (numeric vector of length n*p*d)

beta

List of p×d matrices representing tensor coefficients

gam

Numeric vector of scalar coefficients

n

Number of observations

p

Number of rows in each beta matrix

d

Number of columns in each beta matrix

rank

Rank of tensor decomposition