Let \(\mu_i = X_i beta\), then \(Pr(y_i=j) = exp(\mu_{i,j}) / \sum_k exp(\mu_{i,k})\).
\(X_i\) is the submatrix of \(X\) corresponding to the
\(i\)th observation. \(X\) has \(n*p\) rows.
Use createX to create \(X\).
References
For further discussion, see Bayesian Statistics and Marketing by Rossi, Allenby, and McCulloch.