Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TMB crashing R #18

Closed
ceciliaOLearySBU opened this issue May 16, 2018 · 1 comment
Closed

TMB crashing R #18

ceciliaOLearySBU opened this issue May 16, 2018 · 1 comment

Comments

@ceciliaOLearySBU
Copy link

What is the most common cause of TMB crashing R when calling the function to optimize?

@James-Thorson
Copy link
Owner

James-Thorson commented May 16, 2018

There's three types of errors typically:

  1. compile errors -- these occur when running TMB::compile, and the error message usually lists a line number and is easy to find and fix

  2. build errors -- these occur during TMB::BuildADFun, and typically occur because you have a loop that exceeds the dimensionality of a vector/matrix/array. These are harder to find on windows than other OS, because it crashes R. You can fix by using a debugger (hard on windows), or commenting out lines in batches to find the offending loop.

  3. inner loop errors -- these occur during the (typically first) inner optimizer call, and often arise because some random effect has a gradient of zero, such that the inner-hessian is not positive definite

  4. outer loop errors -- these most often happen when the hessian for fixed effects is not positive definite at the MLE, due to some non-identifiable or non-estimable parameter.

Issues 3-4 you can check by, respectively, turning off the random effects or integrating them out, extracting the Hessian, getting its eigendecomposition, and inspecting the eigenvectors associated with zero-valued eigenvalues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants