cor_sar | R Documentation |
Thse functions are deprecated. Please see sar
for the new
syntax. These functions are constructors for the cor_sar
class
implementing spatial simultaneous autoregressive structures.
The lagsar
structure implements SAR of the response values:
y = \rho W y + \eta + e
The errorsar
structure implements SAR of the residuals:
y = \eta + u, u = \rho W u + e
In the above equations, \eta
is the predictor term and
e
are independent normally or t-distributed residuals.
cor_sar(W, type = c("lag", "error"))
cor_lagsar(W)
cor_errorsar(W)
W |
An object specifying the spatial weighting matrix.
Can be either the spatial weight matrix itself or an
object of class |
type |
Type of the SAR structure. Either |
Currently, only families gaussian
and student
support SAR structures.
An object of class cor_sar
to be used in calls to
brm
.
## Not run:
data(oldcol, package = "spdep")
fit1 <- brm(CRIME ~ INC + HOVAL, data = COL.OLD,
autocor = cor_lagsar(COL.nb),
chains = 2, cores = 2)
summary(fit1)
plot(fit1)
fit2 <- brm(CRIME ~ INC + HOVAL, data = COL.OLD,
autocor = cor_errorsar(COL.nb),
chains = 2, cores = 2)
summary(fit2)
plot(fit2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.