pysal / splot

Lightweight plotting for geospatial analysis in PySAL
BSD 3-Clause "New" or "Revised" License
98 stars 26 forks source link

BUG: OLS regression in moran is wrong #186

Closed martinfleis closed 2 months ago

martinfleis commented 2 months ago

Regression line in Moran's plot should be modelled as using lag as independent and z score as dependent. Right now it is the other way, that is why the regression line does not indicate the value of Moran's I.

https://github.com/pysal/splot/blob/7b6459b7e0a424050d038c379e52eb091d635e59/splot/_viz_esda_mpl.py#L279

Once switched, the plot is consistent with GeoDa.

xref discussion in #185

martinfleis commented 2 months ago

Closed by #187