(1) you put rows of zeroes in your X matrix for the āoutside choiceā. Iām a little unclear about this. Can you explain how the zeros in X normalize the person level parameters? (if that is what is going on). Along those same lines, if you didnāt have X2, would you not need those zeros?

- Yep. Remember the decision rule is āmake the choice that maximises utilityā. If I add some number to all utilities across available choices, then the choice remains the same, but the utilities change. So you need to anchor the utilities to something. We do this with an āoutside goodā-- typically, the decision to make none of the available choices. By custom, the utility of the outside good is 0. Recall that choice probabilities for person i, good j assuming an iid Gumbel idiosyncratic utility are

p_{ij} = \frac{\exp(u_{ij})}{\sum_{k=1}^{J+1} \exp(u_{ik})}

well if our outside good gives u_{iJ+1}= 0 then

p_{ij} = \frac{\exp(u_{ij})}{1 + \sum_{k=1}^{J} \exp(u_{ik})}

and all the parameters in our utility functions become interpretable as log on the impact of the choice attribute with respect to making no choice at all.

(2) How would you suggest constructing pointwise log likelihood vector in generated quantities to do WAIC/LOO calculations outside of Stan? Iām having trouble translating your

target += log_probā * choice;

into

log_lik = categorical_logit_lpmf(choice, log_prob)

Remember that a categorical likelihood contribution for an observation across k choices where x_k=1 indicates the k-th choice is made is

L(x | p) = \prod_{k = 1}^{K} p_{k}^{x_{k}}

so the log likelihood contribution of an observation

\log(L(x|p)) = \sum_{k=1}^{K} = x_{k}\log(p_{k}) = \log(p_{k})

The notation I use to calculate the log likelihood of the full sample is just `choice for person 1 * log probability for person 1's choice + ... + choice for person N * log probability for that choice`

which is just the dot product of a binary vector of choices and the log probability of those choices.

The pointwise log likelihood, for loo, is just the log probability at the given choice.

Hope this helps!