Calculate fitted values of Moran's I as linear regression.

FitMoransI(X, Y, I, all = FALSE)

Arguments

X

A matrix with observations as rows and features as columns.

Y

A matrix of spatial lags.

I

A matrix of Moran's I, output by OLSMoransI..

all

Whether to use multivariate Moran's I, default is FALSE.

Value

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.

References

Anselin, L. Local indicators of spatial association-LISA. Geogr. Anal. 27, 93–115 (2010)

Examples

{
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)
}