get_lower_upper_smart: Turn default/special upper and lower arguments to vectors

View source: R/utils.R

get_lower_upper_smartR Documentation

Turn default/special upper and lower arguments to vectors

Description

The function is used in the depths of the package to get the search space as a vector, matching with the free parameters of a model. Only relevant when users use the "default parameters" approach where they only specify the parameter labels and assume the package figures out how each parameter relates across conditions (see simulate_data). This comes in handy, when freeing a parameter across conditions, while the search space remains the same (otherwise, a user would always have to adapt the vectors for lower/upper to match with x2prms_vals)

Usage

get_lower_upper_smart(drift_dm_obj, lower, upper, labels = TRUE)

Arguments

drift_dm_obj

an object of type drift_dm

lower, upper

either a vector or list (see create_matrix_l_u)

labels

optional logical, if TRUE, then the returned vectors have the unique parameter labels according to prm_cond_combo_2_labels.

Details

The function first gets all unique parameters across conditions using prms_cond_combo. The unique parameter labels are then forwarded to create_matrix_l_u, together with all (!) the conditions in the model and the upper/lower arguments. Subsequently, the created matrices are wrangled into vectors in accordance with prms_cond_combo. The vectors are then passed back.

Value

a list with two vectors named lower/upper that describe the search space. The length and names (if requested) matches with coef(model, select_unique = TRUE).


dRiftDM documentation built on April 3, 2025, 7:48 p.m.