Calculate fitted values of Moran's I as linear regression.
FitMoransI(X, Y, I, all = FALSE)
A matrix with observations as rows and features as columns.
A matrix of spatial lags.
A matrix of Moran's I, output by OLSMoransI
..
Whether to use multivariate Moran's I, default is FALSE
.
A list containing the following:
residuals, residuals of fitted Moran's I.
fitted.values, fitted values of Moran's I.
all.fitted.values, a three-dimensional tensor of all fitted multivariate Moran's I, if calculated.
all.residuals, a three-dimensional tensor of all residuals using fitted multivariate Moran's I, if calculated.
Anselin, L. Local indicators of spatial association-LISA. Geogr. Anal. 27, 93–115 (2010)
{
data.use <- quakes[1:100,]
W <- 1/as.matrix(dist(data.use[,1:2]))
diag(W) <- 0
res <- OLSMoransI(data.use[,3:4], W)
res.fitted <- FitMoransI(res$X, res$Y, res$Morans.I)
}