build_model_boolean_r | R Documentation |
Constructs a 3D boolean array indicating parameter-condition-response association to represent the experimental design.
build_model_boolean_r(parameter_map_r, factors_r, accumulators_r, match_map_r)
parameter_map_r |
An Rcpp::List where each element maps parameters
to conditions (character vector). The element names indicates
the model parameter. The element content is the factor name that
assocaites with a model parameter. |
factors_r |
An Rcpp::List where each element defines factor levels (character vector). Names should be factor names. |
accumulators_r |
A character vector (std::vector<std::string>) of accumulator names. I use 'accumulator' to remind the difference of the implicit accumulator and the manifested response. Mostly, you may mix the two; however, sometimes, merging the two concepts may result in conceptual errors. |
match_map_r |
An Rcpp::List that defines the mapping between stimuli and responses, specifying which response are considered correct or incorrect. (This is a nested list structure). |
The function:
Converts all R inputs to C++ maps for efficient processing
Builds experimental design cells using build_cell_names
Processes parameter-condition mappings with add_M
Applies match map constraints to determine valid combinations
Returns results as a 3D logical array compatible with R
An R logical array with dimensions:
1st dimension: Parameters (column)
2nd dimension: Conditions (row)
3rd dimension: Responses (slice)
Where 'TRUE' indicates the model assumes that a model parameter (1st dimension) affects a condition (2nd dimension) at a particular response (3rd dimension).
Used when you need to:
Validate experimental design completeness
Generate design matrices for model fitting
Check response-condition constraints
p_map <- list(A = "1", B = "1", mean_v = "M", sd_v = "1", st0 = "1",
t0 = "1")
match_map <- list(M = list(s1 = "r1", s2 = "r2"))
factors <- list(S = c("s1", "s2"))
accumulators <- c("r1", "r2")
result <- build_model_boolean_r(p_map, factors, accumulators, match_map)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.