Create INLA mesh for spatial analysis
compute_mesh.Rdcompute_mesh create objects required for INLA analysis of an object of class "CRTsp".
Usage
compute_mesh(
  trial = trial,
  offset = -0.1,
  max.edge = 0.25,
  inla.alpha = 2,
  maskbuffer = 0.5,
  pixel = 0.5
)Arguments
- trial
 an object of class
"CRTsp"or a data frame containing locations in (x,y) coordinates, cluster assignments (factorcluster), and arm assignments (factorarm) and outcome.- offset
 see
inla.mesh.2ddocumentation- max.edge
 see
inla.mesh.2ddocumentation- inla.alpha
 parameter related to the smoothness (see
inladocumentation)- maskbuffer
 numeric: width of buffer around points (km)
- pixel
 numeric: size of pixel (km)
Value
list
predictionData frame containing the prediction points and covariate valuesAprojection matrix from the observations to the mesh nodes.Approjection matrix from the prediction points to the mesh nodes.indexsindex set for the SPDE modelspdeSPDE modelpixelpixel size (km)
Details
compute_mesh carries out the computationally intensive steps required for setting-up an
INLA analysis of an object of class "CRTsp", creating the prediction mesh and the projection matrices.
The mesh can be reused for different models fitted to the same
geography. The computational resources required depend largely on the resolution of the prediction mesh.
The prediction mesh is thinned to include only pixels centred at a distance less than
maskbuffer from the nearest point.
A warning may be generated if the Matrix library is not loaded.