The raster resolution is not related to the dimension of your data.
You can estimate such surface in high or small resolution with few
or larger number of observations. The main limitation is the number
of basis functions, related to number of mesh triangles.
The main argument is max.edge=c(a,b), where
a = maximum length of the inner edges
b = maximum length of the outer edges
So, you can have a mesh with few triangles when you set 'a' and 'b'
bigger and you can have a mesh with more triangles setting they
smaller values. An important argument is the 'cuttof', used to avoid
small triangles.
For non-convex shaped domains, it is good to consider using the
inla.nonconvex.hull() function before creating the mesh. Please
consider the following examples:
require(maps)
us <- map("usa", fill=TRUE, col="transparent", plot=FALSE)
IDs <- sapply(strsplit(us$names, ":"), function(x) x[1])
require(sp)
prj <- CRS("+proj=longlat +datum=WGS84")
require(maptools)
sp <- map2SpatialPolygons(us, IDs=IDs, proj4string=prj)
### first way: using the polygon
require(INLA)
pl.bound <- inla.sp2segment(sp)
mesh0 <- inla.mesh.2d(boundary=pl.bound, max.edge=c(3,7),
cutoff=1)
### second way: using the location points
## suppose you have these points:
require(splancs)
pts <- csr(sp@polygons[[3]]@Polygons[[1]]@coords, 1e5)
require(INLA)
pt.bond <- inla.nonconvex.hull(pts, 2, 2)
pt.bond2 <- inla.nonconvex.hull(pts, 1, 1, 100)
mesh1 <- inla.mesh.2d(boundary=pt.bond, max.edge=c(5,10), cut=1)
mesh2 <- inla.mesh.2d(boundary=pt.bond, max.edge=c(3,7), cut=1)
mesh3 <- inla.mesh.2d(boundary=pt.bond2, max.edge=c(2,4), cut=1,
off=c(1e-5,4))
c(mesh0$n, mesh1$n, mesh2$n, mesh3$n)
par(mfrow=c(2,2), mar=c(0,0,1,0))
plot(mesh0, asp=1)
plot(mesh1, asp=1)
plot(mesh2, asp=1)
plot(mesh3, asp=1)
best,
Elias.