make.M {DSSP} | R Documentation |
Precision Matrix Function
Description
This function creates the precision matrix for the spatial prior based on thin-plate splines and returns the matrix M, and its eigenvalues and eigenvectors
Usage
make.M(X, covariates)
Arguments
X |
a matrix of spatial coordinates. It is recommended that the coordinates be scaled and centred. |
covariates |
the observed values for the covariates (including intercept). |
Details
The M matrix is the precision matrix for the spatial effects from the direct sampling spatial prior (DSSP) model. M is based on thin plate splines basis functions, see White et. al. 2019 for more details on how the matrix M is constructed.
Value
A list containing the precision matrix M and the object M.eigen containing eigenvalues and eigenvectors for the matrix M.
Examples
## Use the Meuse River dataset from the package 'gstat'
library(sp)
library(gstat)
data(meuse.all)
coordinates(meuse.all) <- ~ x + y
X <- scale(coordinates(meuse.all))
make.M(X)
[Package DSSP version 0.1.1 Index]