[R-sig-ME] GAMM (gamm4) warning: Hessian vs. RX var-cov

Meaghan Rupprecht rupprecht @end|ng |rom unbc@c@
Mon Jan 1 00:07:44 CET 2024


Good afternoon and Happy New Year everyone~

I am running a series of models using various records of fish catch from different datasets. Datasets include a different number of records but are being modelled with the same general formula (the number of records in each dataset ranges from ~3,000 to ~20,000).

The general model formula is as follows:
fit <-
    uGamm(catch ~ s(effort, k = 30) + s(month, bs = 'cc', k = 12) + s(year, k = 15) + s(habitat, k = 15) + s(pop_dens, k = 15) + s(X,Y, bs= 'ts', k = 15) + s(saberes_boat_id, bs = 're') + s(landing_mun, bs = 're') + s(basin_id, bs = 're'),
          family = Gamma(link = 'log'),
          data = fish_catch,
          control = glmerControl(optimizer = 'bobyqa',
                                 optCtrl = list(maxfun = 2e5)),
          lme4 = TRUE)

I am using the uGamm wrapper so that I can complete model averaging with the MuMIn package, but the models are being run with gamm4.

The resulting models of several datasets provide me with the following warning when I attempt model selection with MuMIn::model.sel():
Warning messages:
1: In vcov(object, use.hessian = use.hessian) :
  variance-covariance matrix computed from finite-difference Hessian is
not positive definite or contains NA values: falling back to var-cov estimated from RX
2: In vcov.merMod(object, correlation = correlation, sigm = sig) :
  variance-covariance matrix computed from finite-difference Hessian is
not positive definite or contains NA values: falling back to var-cov estimated from RX

With the above information in mind, I have several questions.

  1.  Are the model results using the smaller datasets less reliable due to this warning?
  2.  Can move forward with model selection and averaging with these errors present?
  3.  If I can't move forward with model selection, how can I address these errors and get to the point where I can complete model selection and averaging?

Best,
Meaghan

	[[alternative HTML version deleted]]



More information about the R-sig-mixed-models mailing list