Fast ways to create sparse precision matrices for various IGMRF.
precmat(n, season=12, m=n, A=NULL, order=1, ... , type="RW1")
precmat.RW1(n)
precmat.RW2(n)
precmat.RWn(n, order=3)
precmat.season(n, season=12)
precmat.IGMRFreglat(n, m, order=1, anisotropy=1)
precmat.IGMRFirreglat(A, eps=getOption("spam.eps"))
A sparse precision matrix.
dimension of the field.
the type of the IGMRF.
length of season.
second dimension (in case of a regular lattice).
adjacency matrix (see below).
order for higher order RWs.
anisotropy factor, between 0 and 2.
tolerance level.
arguments passed to individual functions.
Reinhard Furrer
precmat
is a wrapper that calls the other functions
according to the argument type
.
Implements many of the precision matrices discussed in Chapter
3 of Rue and Held (2005). For example, precmat.RW1
,
precmat.RW2
and precmat.season
are given in
equations (3.22), (3.40) and (3.59); precmat.IGMRFreglat
on
page 107. Note that for the latter we reverse the order of the dimension here!
If adjacency matrix is a regular matrix, it is coerced to a
spam
object. Only the structure is used. Make sure, that the
diagonal is empty.
Rue and Held (2005).
precmat.GMRFreglat
, rmvnorm.prec
, adjacency.landkreis
.
n <- 10
Q <- precmat.RW2( n)
# rmvnorm.prec(1, Q=Q) # does not work, because the matrix is singular.
Q%*%cbind(1,1:n)
Run the code above in your browser using DataLab