BTRTucker: Bayesian tensor regression with the Tucker decomposition

View source: R/402_BTRTucker.R

BTRTuckerR Documentation

Bayesian tensor regression with the Tucker decomposition

Description

Bayesian tensor regression with the Tucker decomposition

Usage

BTRTucker(
  input,
  ranks = rep(1, length(dim(input$X)) - 1),
  n_iter = 100,
  n_burn = 0,
  CP = FALSE,
  hyperparameters = NULL,
  save_dir = NULL
)

Arguments

input

An object of class TR_data that contains (at least) the elements y (a vector of response values) and X (an array of covariate values). Optionally, eta (a matrix of nuisance covariates) can also be included. Other list elements will be ignored.

ranks

A vector of length length(dim(input$X)) - 1 giving the desired number of ranks per dimension of the tensor coefficient

n_iter

(a scalar) the number of posterior samples desired

n_burn

(a scalar) the number of posterior samples to discard as a burn-in

CP

Should the model be reduced to the CP decomposition? Default: FALSE

hyperparameters

a list with the (scalar) elements a.tau, b.tau, a.lam, b.lam, nu, s_02, a.sig, b.sig, Sig_0, mu_gam, alpha.grid, a.u, b.u, a.z, and/or b.z, defining the values of the hyperparameters within the model. If NULL, then default values will be used. It is also possible to specify only a subset of the hyperparameters. The remaining hyperparameters are set to their default values.

save_dir

(a character) A path to a directory in which the temporary results will be saved. Defaults to the current working directory. If NULL, no temporary saves are made.

Value

A list with the posterior samples

Examples

## Not run: 
input <- TR_simulated_data()
results <- BTRTucker(input)

## End(Not run)

danieladamspencer/bayestensorreg documentation built on July 23, 2024, 10:14 a.m.