mk_toy: Make a toy dataset to test the 3d BaTFLED model.

Description Usage Arguments Value Examples

View source: R/mk_toy.R

Description

Returns a toy model with the specified size, sparsity and noise generated either with a CP or Tucker factorization model. Values in predictor matrices (X1, X2, X3) are pulled from a standard normal distribuion. Dummy names are given to the predictors.

Usage

1
mk_toy(params)

Arguments

params

list of parameters created with get_data_params

Value

a list containing elements of the model

mode1.X

Input data for mode 1

mode2.X

Input data for mode 2

mode3.X

Input data for mode 3

mode1.A

Projection matrix for mode 1

mode2.A

Projection matrix for mode 2

mode3.A

Projection matrix for mode 3

mode1.H

Latent matrix for mode 1

mode2.H

Latent matrix for mode 2

mode3.H

Latent matrix for mode 3

core

Core tensor if params$decomp=='Tucker'

resp

Response tensor

Examples

1
2
3
4
5
data.params <- get_data_params(c('decomp=Tucker'))
toy <- mk_toy(data.params)

data.params <- get_data_params(c('decomp=CP'))
toy <- mk_toy(data.params)

nathanlazar/BaTFLED3D documentation built on May 23, 2019, 12:19 p.m.