sele_rank: Rank selection

View source: R/tensor_regress.R

sele_rankR Documentation

Rank selection

Description

Estimate the Tucker rank of tensor decomposition based on BIC criterion. The choice of BIC aims to balance between the goodness-of-fit for the data and the degree of freedom in the population model.

Usage

sele_rank(
  tsr,
  X_covar1 = NULL,
  X_covar2 = NULL,
  X_covar3 = NULL,
  rank_range,
  niter = 10,
  cons = "non",
  lambda = 0.1,
  alpha = 1,
  solver = "CG",
  dist,
  initial = c("random", "QR_tucker")
)

Arguments

tsr

response tensor with 3 modes

X_covar1

side information on first mode

X_covar2

side information on second mode

X_covar3

side information on third mode

rank_range

a matrix containing rank candidates on each row

niter

max number of iterations if update does not convergence

cons

the constraint method, "non" for without constraint, "vanilla" for global scale down at each iteration,

"penalty" for adding log-barrier penalty to object function.

lambda

penalty coefficient for "penalty" constraint

alpha

max norm constraint on linear predictor

solver

solver for solving object function when using "penalty" constraint, see "details"

dist

distribution of response tensor, see "details"

initial

initialization of the alternating optimiation, "random" for random initialization, "QR_tucker" for deterministic initialization using tucker decomposition

Details

For rank selection, recommend using non-constraint version.

Constraint penalty adds log-barrier regularizer to general object function (negative log-likelihood). The main function uses solver in function "optim" to solve the objective function. The "solver" passes to the argument "method" in function "optim".

dist specifies three distributions of response tensor: binary, poisson and normal distributions.

Value

a list containing the following:

rank a vector with selected rank with minimal BIC

result a matrix containing rank candidate and its loglikelihood and BIC on each row

Examples

seed=24
dist='binary'
data=sim_data(seed, whole_shape = c(20,20,20),
core_shape=c(3,3,3),p=c(5,5,5),dist=dist, dup=5, signal=4)
rank_range = rbind(c(3,3,3),c(3,3,2),c(3,2,2),c(2,2,2),c(3,2,3))
re = sele_rank(data$tsr[[1]],data$X_covar1,data$X_covar2,data$X_covar3,
 rank_range = rank_range,niter=10,cons = 'non',dist = dist,initial = "random")

tensorregress documentation built on July 9, 2023, 7:23 p.m.