build_model_boolean_r: Build Model Boolean

View source: R/RcppExports.R

build_model_boolean_rR Documentation

Build Model Boolean

Description

Constructs a 3D boolean array indicating parameter-condition-response association to represent the experimental design.

Usage

build_model_boolean_r(parameter_map_r, factors_r, accumulators_r, match_map_r)

Arguments

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. 1 represents no assocation.

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).

Details

The function:

  1. Converts all R inputs to C++ maps for efficient processing

  2. Builds experimental design cells using build_cell_names

  3. Processes parameter-condition mappings with add_M

  4. Applies match map constraints to determine valid combinations

  5. Returns results as a 3D logical array compatible with R

Value

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).

Typical Use Case

Used when you need to:

  • Validate experimental design completeness

  • Generate design matrices for model fitting

  • Check response-condition constraints

Examples

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)


ggdmcModel documentation built on Aug. 8, 2025, 7:50 p.m.