kaskr / TMB_contrib_R

9 stars 6 forks source link

NAs in bias correction #10

Closed brianstock-NOAA closed 3 years ago

brianstock-NOAA commented 3 years ago

In case this is useful for others...

I was getting NAs using the TMB epsilon bias correction, i.e.

sdrep <- TMB::sdreport(mod, bias.correct=TRUE)
summary(sdrep)[,3] # all NA

The model was estimated well (sdrep$pdHess, sdrep$diag.cov.random, sdrep$gradient.fixed, and diag(sdrep$cov.fixed) all looked good). I uncovered a number of issues by

  1. only bias-correcting a subset of derived quantities (using bias.correct.control$split)
  2. sdrep$value[!is.finite(sdrep$value)]
  3. sdrep$sd[sdrep$sd==0]

Some combination of the following were to blame:

Happy debugging!