Do you have any resources or good inspiration for an implementation based on mlogit
/polr
? The infrastructure has been developed for those so I suppose it would only take some flavor syntax,
@formula(response | options ~ id | explanatory variables)
Maybe something like that where the table looks like (for the cmlogit)
outcome option id price income
true train 1 $50 $60,000
false flight 1 $500 $60,000
Then we would only have to adapt the objective function (conditional log-likelihood) and compute the gradient. For ologit, I had to use a trick for the AD to work properly (inspired on the MASS implementation).