Learn R Programming

TensorMCMC (version 0.1.0)

tensor.reg: Tensor Regression using Rcpp

Description

Low-rank tensor regression with stochastic updates

Usage

tensor.reg(
  z.train,
  x.train,
  y.train,
  nsweep = 50,
  rank = 2,
  scale = TRUE,
  alpha.lasso = 1
)

Value

A list with beta.store, gam.store, rank, p, d, and scaling info

Arguments

z.train

Matrix of scalar covariates (n x pgamma)

x.train

3D array of tensor predictors (n x p x d)

y.train

Response vector (length n)

nsweep

Number of stochastic update iterations (default 50)

rank

Rank of tensor decomposition (default 2)

scale

whether to scale predictors and response (default TRUE)

alpha.lasso

LASSO tuning parameter for initial estimate (default 1)