2018_FSH556
2018_FSH556 copied to clipboard
Optimizer Error for random = NA
I noticed setting random = NA (for the first model) results in the error (only when trying to optimize): TMB as received an error from Eigen. index>=0 && index < size()
I removed the random call from the makeADFun() function, and then the optimizer runs fine. Do you always need a value for random when using it in the makeADFun() call?
if you do args(TMB::MakeADFun)
you'll see that the default is random=NULL
. Therefore, if you have a model without any random effects, you can either not include anything for slot random
or equivalently fix random=NULL