Hello,
I am working on a spatial analysis using the INLA package in R and have encountered a persistent error with my SPDE model configuration. The error message is as follows:
Error in inla.core.safe(formula = formula, family = family, contrasts = contrasts, :
Argument spde.prefix=NULL is required for model = spde
The inla program failed and the maximum number of tries has been reached.
Here is the simplified version of the code I am using:
library(INLA)
mesh <- inla.mesh.2d(loc = coords, max.edge = c(0.1, 0.5), cutoff = 0.05)
spde <- inla.spde2.pcmatern(mesh, prior.range = c(1000, 0.1), prior.sigma = c(1, 0.05))
formula <- blue_space ~ White + f(spde, model = "spde", n = mesh$n, spde.prefix = NULL)
result <- inla(formula, family = "gaussian", data = mydata)
Could someone help me understand why this error occurs and how to resolve it?
Thank you very much for your time and help!