Hans J. Skaug

Results 15 comments of Hans J. Skaug

Let me take the good news first: `gdbsource` now seems to work on Windows (R 3.5.0 and Rtools 3.5.0.1). Even better is that `flag="-O0 -g"` is working, which gives much...

Thanks. I had only tried on a toy model. `sam.cpp` still does not work. In fact, it will not even compile with `-O0 -g`.

Yes, this is a generic problem, and mark-recapture is a good way to illustrate it. You cannot apply "weights" inside the C++ template when you use random effects. It messes...

Yes, this is what I meant; apply the weighting on the R side. I do not see an easy way around calling MakeADFun multiple times. You can store the resulting...

Hi, You are right that there is a conceptual issue when the model contains both (fixed effects) parameters theta and latent random variables "u". TMB calculates the MLE theta^ and...

Your penealty is non-differentiable, which can lead to problem for the function optimizer. Try a quadratic penalty instead, available easily via dnorm(blow-lupp,0,1,true).sum();

The right approach is to use the debugger to trap the first occurrence of NaN. See: http://kaskr.github.io/adcomp/group__Errors.html (scroll down to Floating point execption). Hans

Yes, the importance sampling weights can be used to diagnose problems with the Laplace approximation in the way you suggest, but I am not aware of any systematic study of...

I think the importance sampling is built on top of the Laplace approximation, so it will also fail in the bimodal case. Maybe you can some HMM type trick to...

I do not have a complete answer to this, but you should seek for a subroutine inside the Eigen library, which is loaded by TMB. Note that library Eigen is...