compute_mesh {CRTspat} | R Documentation |
compute_mesh
create objects required for INLA analysis of an object of class "CRTsp"
.compute_mesh
create objects required for INLA analysis of an object of class "CRTsp"
.
compute_mesh(
trial = trial,
offset = -0.1,
max.edge = 0.25,
inla.alpha = 2,
maskbuffer = 0.5,
pixel = 0.5
)
trial |
an object of class |
offset |
see |
max.edge |
see |
inla.alpha |
parameter related to the smoothness (see |
maskbuffer |
numeric: width of buffer around points (km) |
pixel |
numeric: size of pixel (km) |
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.
list
prediction
Data frame containing the prediction points and covariate values
A
projection matrix from the observations to the mesh nodes.
Ap
projection matrix from the prediction points to the mesh nodes.
indexs
index set for the SPDE model
spde
SPDE model
pixel
pixel size (km)
{
# low resolution mesh for test dataset
library(Matrix)
example <- readdata('exampleCRT.txt')
exampleMesh=compute_mesh(example, pixel = 0.5)
}