Renames the columns of x_j from terms to parameters, so that a generic parameter is a single column even if its attribute has a different name in each alternative. Parameters that do not enter the utility function of an alternative are zero for that alternative. The columns are ordered as the priors, which ensures that the variance-covariance matrix derived by derive_vcov matches the priors.

align_x_j(x_j, terms, names_priors)

Arguments

x_j

A list of model matrices returned by define_x_j

terms

A list of terms and their parameters returned by pair_param_terms

names_priors

The names of the priors

Value

The list x_j with one column per prior in the order of the priors