TR_simulated_data: Simulated tensor regression data

View source: R/001_data_simulation.R

TR_simulated_dataR Documentation

Simulated tensor regression data

Description

Simulated tensor regression data

Usage

TR_simulated_data(
  subjects = 400,
  tensor_dims = c(50, 50),
  CNR = 1,
  num_active = 3,
  other_covar = c(1, 1)
)

Arguments

subjects

A positive integer indicating the number of subjects for which to generate data

tensor_dims

A vector that indicates the dimensions of the tensor covariate for each subject

CNR

The contrast-to-noise ratio, defined by Welvaert and Rosseel (2013) as the size of the (largest) true coefficient value divided by the observational noise.

num_active

The number of contiguous nonzero activation regions

other_covar

A vector of true values for other (nuisance) coefficients that will be used to generate non-tensor-valued covariates. This can be set to NULL if no other covariates are desired in the simulated data.

Value

An object of class TR_data that contains the elements y (a vector of response values), X (an array of covariate values), eta (a matrix of nuisance covariates), true_B (an array with the true tensor coefficient values), and gam (a vector with the true nuisance coefficient values)

Examples

input <- TR_simulated_data()

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