Closed tiboloic closed 5 months ago
dmultinom
is available in RTMB (see ?Distributions
).
The problem is in your nLL
where getAll(par)
should actually be getAll(params)
:)
Edit: I think getAll
could be improved to avoid this kind of mistake, by requiring that the argument exists in the calling frame.
Apologies for the trivial error. Thank you so much for looking into it.
For revising a paper I am porting some TMB code to RTMB. It is a random effect model with a mutltinomial response, but I cannot get it to work. Since I didn't find a implementation of
dmultinom
indistributions.R
, I have also tried my own implementation ofdmultinom
without success.Here is a snippet of code: