Thanks, Ben. I'm happy to keep out of mark-resight complexity where I can.
'secr' should not have crashed in this case. I have added a check in the next release - it aborts with a message if the mark-resight model includes any learned response. A learned response within the marking phase should be manageable, but would need some special coding, and I'd rather just block learned responses in general for mark-resight data.
Dusit's data gave me another problem that I don't fully understand. With the default (automatic) starting values the Nelder-Mead method for likelihood maximisation sometimes stops at a bad estimate that is not even a local maximum as far as I can tell by plotting the likelihood surface. The Newton-Raphson method simply fails with default starting values. Given reasonable starting values both methods get to about the same likelihood and estimates.
set.seed(123)
testA <-secr.fit(MFR, model = list(D~1, g0~1, sigma~1), buffer = 5000,
details = list(knownmarks = FALSE), method = "Nelder-Mead")
etc.
AIC(testA,testB,testC,testD, testE, testF, testG)
model detectfn npar logLik AIC AICc dAICc AICcwt
testE D~1 g0~1 sigma~1 pID~1 halfnormal 4 -3711.679 7431.357 7431.415 0.000 0.2501 Newton-Raphson, testA start
testF D~1 g0~1 sigma~1 pID~1 halfnormal 4 -3711.679 7431.357 7431.415 0.000 0.2501 Nelder-Mead, testA start
testD D~1 g0~1 sigma~1 pID~1 halfnormal 4 -3711.679 7431.358 7431.416 0.001 0.2499 Newton-Raphson, testB start
testG D~1 g0~1 sigma~1 pID~1 halfnormal 4 -3711.679 7431.358 7431.416 0.001 0.2499 Nelder-Mead, testB start
testC D~1 g0~1 sigma~1 pID~1 halfnormal 4 -3732.231 7472.462 7472.520 41.105 0.0000 Nelder-Mead, automatic
testB D~1 g0~1 sigma~1 pID~1 halfnormal 4 -3739.202 7486.404 7486.462 55.047 0.0000 Nelder-Mead, automatic
testA D~1 g0~1 sigma~1 pID~1 halfnormal 4 -3744.819 7497.638 7497.696 66.281 0.0000 Nelder-Mead, automatic