Defines x_j, the list of attribute matrices with one matrix per alternative. Each matrix has one column per term in the utility function of that alternative: attributes, expanded dummy-coded attributes and, if requested, interaction terms. The columns are named after the terms and keep the order of model.matrix.

define_x_j(
  utility,
  design_candidate,
  terms = pair_param_terms(update_utility(utility)),
  interactions = TRUE
)

Arguments

utility

A named list of utility functions. See the examples and the vignette for examples of how to define these correctly for different types of experimental designs.

design_candidate

The current design candidate under consideration

terms

A list of terms and their parameters returned by pair_param_terms. The default pairs the terms of the updated utility functions.

interactions

If TRUE, include interaction terms. The default is TRUE.

Value

A list of model matrices, one per alternative