Two autoregressive(AR) models are currently implemented: the adjacency
model (a conditional AR, i.e., CAR), and the AR1
model for time series. Implementation of further models (in particular, of simultaneous AR, i.e., SAR) is to be expected in the future.
Efficient algorithms for CAR models have been widely discussed in particular in the econometric literature (e.g., LeSage and Pace 2009), but these models are not necessarily recommended for irregular lattices (see Wall, 2004 and Martellosio, 2012 for some insights on the implications of autoregressive models). The fastest method in spaMM for large data sets is implemented in the fitme
function. For small data sets (as in the example below), HLCor
may be fastest. It is suggested to use fitme
generally unless one has a large number of small data sets to analyze. For non-LMMs, corrHLfit(*,HLmethod="PQL/L")
can be quite fast (but does not return an ML or REML fit).
An AR1 random effect is specified as AR1(1|<grouping factor>)
. It describes correlations between realizations of the random effect for (typically) successive time-steps by a correlation \(\phi\), denoted ARphi
in function calls. Nested AR1 effects can be specified by a nested grouping factor, as in AR1(1|<time index> %in% <nesting factor>)
.
A CAR random effect is specified as adjacency(1|<grouping factor>)
. The correlations among levels of the random effect form a
matrix (I\(-\rho\) adjMatrix
\()^{-1}\), in terms of an adjMatrix
matrix which must be provided, and of the scalar \(\rho\), denoted rho
in function calls.
The rows and columns of adjMatrix
must be ordered as increasing values of the levels of the geographic
location index specifying the spatial random effect. For example, if the model formula
is
y ~ adjacency(1|geo.loc)
and <data>$geo.loc
is 2,4,3,1,... the first row/column of the matrix refers to geo.loc
=1, i.e. to the fourth row of the data.