Mesh settings
Mesh Parameters
Parameters are on the scale of spatial coordinates (e.g., if working in Easting and Northing, the parameters will be in km).
max.edge
max.edgedefines the maximum length of triangle edges. Lower values mean smaller triangles, resulting in a finer overall mesh.max.edgecan have one or two input values.- One value would be used for a mesh with no outer boundary extension (not recommended).
- Two values relate to the specification for the inner mesh (inside the inner mesh boundary) and outer mesh (between the inner and outer mesh boundaries).
- In the outer mesh,
max.edgecan be very large, as we are not interested in fine-scale inference for this area. We also want this to be a large value to improve computational efficiency, as the number of nodes in the mesh is proportional to the running time of the model. - In the inner mesh, we need to have a fine enough resolution to capture the processes we are interested in. This means that we want the
max.edgeto be smaller than the spatial range across which we would expect our points to be correlated (SPDE range parameter).- Initially, if we have no other prior knowledge about the SPDE range parameter, we can approximate it as 1/3 of the study area, but it should then be replaced once a posterior estimate is obtained. The
max.edgeshould then be between 1/10 and 1/5 of this spatial range value.
- Initially, if we have no other prior knowledge about the SPDE range parameter, we can approximate it as 1/3 of the study area, but it should then be replaced once a posterior estimate is obtained. The
- A mesh with a finer resolution will lead to a higher number of mesh nodes, resulting in a model with a longer running time. So, when choosing a value for
max.edge, consider the size of the study area and look at the number of nodes in your resulting mesh.
min.angle
min.angledefines the minimum angles at which triangles join.min.anglecan have one or two input values.- One value would be used for a mesh with no outer boundary extension (not recommended).
- Two values relate to the specification for the inner mesh (inside the inner mesh boundary) and outer mesh (between the inner and outer mesh boundaries).
- I believe changing
min.anglehas a similar effect on the overall mesh to changingmax.edge, but with a less intuitive interpretation. I would therefore avoid specifying this parameter explicitly in mesh construction.
offset
offsetdefines the extension distance for the mesh boundaries.offsetcan have one or two input values.- One value would be used for a mesh with no outer boundary extension (not recommended).
- Two values relate to the specification for the inner mesh (inside the inner mesh boundary) and outer mesh (between the inner and outer mesh boundaries).
- An outer boundary extension is required to buffer the Boundary Effect. The Boundary Effect is an increase in the SD of estimates near the boundary, due to a boundary condition imposed on the SPDE. In order to avoid this, we create a boundary extension, leaving this effect at the outer boundary, so it doesn’t impact our area of interest (within the inner boundary).
- A general rule is to use 1\(\times\) the
max.edgefor the inner boundaryoffsetand 5\(\times\) themax.edgefor the outer boundaryoffset. - The effectiveness of our outer boundary on buffering the Boundary Effect can be evaluated using the meshbuilder() tool (example below).
- If negative,
offsetis interpreted as a factor relative to the approximate data diameter.
cutoff
cutoffdefines the minimum allowed distance across which 2 mesh nodes are required. Nodes which are at most as far apart as this are replaced by a single vertex.- In other words,
cutoffrepresents the minimum distance across which two vertices are required, and so works in tandem withmax.edgeto determine mesh resolution. - The main purpose of
cutoffis to even-out the size of triangles in the mesh, so that all triangles in the area of interest (inside the inner mesh boundary) are a similar size.- When using points as a base to build a mesh from, we can end up with clusters of small triangles around these points. Increasing
cutoffsmooths this out, so that all triangles in the inner mesh are a similar size. Acutoffvalue ofmax.edge/5 usually evens out clustering.
- When using points as a base to build a mesh from, we can end up with clusters of small triangles around these points. Increasing
- Decreasing the
cutoffvalue can help to better represent complex boundaries such as coastlines, as the number of triangles along complex edges is increased. A largercutoffvalue may smooth over these edges, resulting in a simplified representation of the boundary.
boundary
boundarycan be used to include a polygon for the area of interest, and is used to create the inner mesh boundary.- There should be at least 1 ‘spatial range’ (i.e., posterior SPDE range parameter) between the boundary and any point. If this is not known, it can be initially approximated as 1/3 of the study area, but should then be replaced once a posterior estimate is obtained.
locs
locscan be used to define point locations from which to build the initial triangulation nodes of the mesh.- This can result in clustering of mesh nodes around point locations, which if undesired, can be fixed using the
cutoffparameter.
Important
This information is obtained from inlabru teaching materials documents Git Repo
For more information about mesh construction visit https://rpubs.com/jafet089/8866871
Footnotes
This vignette was created based on the older
inla.mesh.2d()function and will be updated tofmeshereventually.↩︎