BTR_CP: Bayesian tensor regression with the CP decomposition

View source: R/403_BTR_CP.R

BTR_CPR Documentation

Bayesian tensor regression with the CP decomposition

Description

This code applies the model by Guhaniyogi et. al. (2017)

Usage

BTR_CP(
  input,
  max_rank = 1,
  n_iter = 100,
  n_burn = 0,
  hyperparameters = NULL,
  save_dir = NULL,
  num_threads = 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.

max_rank

(a scalar) The rank of the CP decomposition to be used

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

hyperparameters

a list with the (scalar) elements a.tau, b.tau, a.lambda, b.lambda, a.epsilon, and b.epsilon defining the values of the hyperparameters within the model. If NULL, then default values will be used.

save_dir

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

num_threads

the number of threads that can be used to find initial conditions

Value

A list with the posterior samples

Examples

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

## End(Not run)

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