GAM models provide NaN p values for few variables

I am trying to fit a dataset by using generalized additive mixed models (gamm) using mgcv package. The fitted model gives NaN p values for a few variables. Can I consider the p values with NaN as not significant and go ahead interpreting the model since I used the model for prediction and it provided reasonable root mean squared error? Or is there any way to fix the NaN p values in mgcv?

Please note that I fitted the same data using INLA and got results for all variables. Does this mean the NaN p values is the problem related to mgcv package?

Traditional frequentist p-values for mixed effects models tend to be very approximate and rely on much more restrictive assumptions than non mixed effects models. So it’s possible the method the mgcv package is using is having some computational issues with your model. INLA does (approximate) Bayesian inference so I think the values it reports based on the estimated posterior distribution of model parameters (and possibly their overlap with 0).

Thanks very much for the quick reply. Is there any other package you would recommend for frequentist gamm? Can I just report the results since the model converged and provided reasonable results for prediction?

I’m not too experienced with GAMM packages, sorry. Given that the fit itself didn’t have convergence issues and you trust the coefficient estimates (I don’t know enough about mgcv to say exactly when this holds) you could use it to make predictions and move to the usual steps of validating and describing the fitted model, etc. But I would caution with modern software packages, barring any errors or inefficiencies in the algorithmic implementation, numerical issues are potentially indicative of broader issues of model implementation (cf Andrew Gelman’s Folk Theorem)