Read in vector of arguments, check their types and add them to a list params
for
building a model of input and response data with known relationships. If a parameter
isn't in the given list the default is used.
get_data_params(args)
A character vector of arguments (character strings) of the form "<name>=<value>". Values will be converted to logical or numeric when necessary. Accepted <names> are below. Defaults in parenthesis:
Either 'CP' or 'Tucker'. (Tucker)
Logical. Should the variance be shared across rows of the projection matrices? This will cause predictors to be or excluded for the whole model, instead of just for particular latent factors. (T)
Numeric. Seed used for random initialization. (NA)
Logical. Should the input data columns should be scaled to have mean 0 and standard deviation 1. (TRUE)
Numeric. Number of rows (samples) for mode 1. (20)
Numeric. Number of rows (samples) for mode 2. (25)
Numeric. Number of rows (samples) for mode 3. (10)
Numeric. Number of columns (predictors) for mode 1. (100)
Numeric. Number of columns (predictors) for mode 2. (150)
Numeric. Number of columns (predictors) for mode 3. (0)
Numeric. If decomp=='CP'
the dimension of the latent space for all modes. (4)
Numeric. If decomp=='Tucker'
the dimension of the core (latent space) for
mode 1. (3)
Numeric. If decomp=='Tucker'
the dimension of the core (latent space) for
mode 2. (3)
Numeric. If decomp=='Tucker'
the dimension of the core (latent space) for
mode 3. (3)
Logical. Should a column of 1s be added to the input data for mode 1. (TRUE)
Logical. Should a column of 1s be added to the input data for mode 2. (TRUE)
Logical. Should a column of 1s be added to the input data for mode 3. (TRUE)
Logical. Should a column of 1s be added to the latent (H) matrix for mode 1. (TRUE)
Logical. Should a column of 1s be added to the latent (H) matrix for mode 2. (TRUE)
Logical. Should a column of 1s be added to the latent (H) matrix for mode 3. (TRUE)
Numeric. Number of predictors for mode 1 (not counting the constant) contributing to the response. (15)
Numeric. Number of predictors for mode 2 (not counting the constant) contributing to the response. (20)
Numeric. Number of predictors for mode 3 (not counting the constant) contributing to the response. (0)
Numeric. Probability (0-1) of the constant term for mode 1 contributing to the response for mode 1. (1)
Numeric. Probability (0-1) of the constant term for mode 2 contributing to the response. (1)
Numeric. Probability (0-1) of the constant term for mode 3 contributing to the response. (1)
Numeric. Standard deviation for sampling values for the projection (A) matrices. (1)
Numeric. Standard deviation for sampling values for the latent (H) matrices. (1)
Numeric. Standard deviation for sampling values for the core tensor. (1)
Numeric. 0 or 1, should a global intercept (0 dimensional intercept) be added
to all responses? Only possible if H1.intercept==H2.intercept==H3.intercept==TRUE
.
core.spar
is used if equal to NA
. (NA)
Numeric. Number of interactions of 1 dimension in the core tensor (non-zero elements
on the edges of the core tensor if H#.intercept==TRUE
). core.spar
is used if
equal to NA
. (NA)
Numeric. Number of interactions of 2 dimensions in the core tensor (non-zero elements
of the faces of the core tensor if H#.intercept==TRUE
). core.spar
is used if
equal to NA
. (NA)
Numeric. Number of interactions of 3 dimensions in the core tensor (non-zero elements
internal to the core tensor). core.spar
is used if equal to NA
. (NA)
Numeric. Fraction of core elements that are non-zero. (1)
Numeric. Relative standard deviation of noise added to response tensor. (0.1)
list of parameters used by mk_toy
function. Values in args
that
are not accepted parameters will be excluded and a warning displayed.
# NOT RUN {
args <- c('decomp=Tucker', 'row.share=F',
'A1.intercept=T', 'A2.intercept=T', 'A3.intercept=F',
'H1.intercept=T', 'H2.intercept=T', 'H3.intercept=T',
'R1=4', 'R2=4', 'R3=2')
data.params <- get_data_params(args)
# }
Run the code above in your browser using DataLab