compute_mesh {CRTspat}R Documentation

compute_mesh create objects required for INLA analysis of an object of class "CRTsp".

Description

compute_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 (factor cluster), and arm assignments (factor arm) and outcome.

offset

see inla.mesh.2d documentation

max.edge

see inla.mesh.2d documentation

inla.alpha

parameter related to the smoothness (see inla documentation)

maskbuffer

numeric: width of buffer around points (km)

pixel

numeric: size of pixel (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.

Value

list

Examples

{
# low resolution mesh for test dataset
library(Matrix)
example <- readdata('exampleCRT.txt')
exampleMesh=compute_mesh(example, pixel = 0.5)
}

[Package CRTspat version 1.2.0 Index]