create_matrix_l_u {dRiftDM} | R Documentation |
Create a matrix for lower and upper
Description
Outsourced, deep inside the package function to avoid large nesting
Usage
create_matrix_l_u(l_u, conds, prm_labels = NULL)
Arguments
l_u |
either a list or a vector of numeric values |
conds |
a character string, conceptually representing the conditions of a model |
prm_labels |
a character string with parameter labels. Used as a fall back when the default_values are not labeled (see details) |
Details
The goal of this function is to build up a matrix, serving as the upper or
lower end of a parameter space (relevant when simulating data). The function
gets called by get_lower_upper_smart()
.
It assumes the following: l_u
is either a list or a numeric vector.
The easiest case is when it is a numeric vector. In this case, the function builds a matrix with as many rows as entries in
conds
. The rows will also be labeled according toconds
. The column names are either the names specified with the numeric vector, or the labels specified inprm_labels
The less intuitive case is when
l_u
is a list. In this case, the list requires an entry called "default_values" which specifies the named or plain numeric vector as above. If the list only contains this entry, then the behavior is as ifl_u
was already a numeric vector. However, thel_u
list can also have entries labeled as specific conditions, which contain named (!) numeric vectors with parameter labels. This will modify the value for the upper/lower parameter space with respect to the specified parameters in the respective condition.#'
Value
a matrix indicating either the upper or lower end of a parameter
space. There will be as many rows as conds
implies. The number of columns
depend on l_u
(matching its length if it is a vector, or matching the
length of the entry "default_values" if it is a list).
See Also
simulate_data()
, simulate_values()