Unexpected range of Local Moran's I values

22 views Asked by At

I'm using the following code to calculate the Local Moran's I, but I noticed that many values in the output, in output lm which is Local Moran's I, are not within the [-1, 1] range. My understanding is that Moran's I values should fall within this range, so I'm confused about what might be causing this.

Can anyone explain why the Local Moran's I values are not within the expected range of [-1, 1]?

Here's the code snippet:

libpysal.weights import KNN
from esda.moran import Moran_Local
import geopandas as gpd

gdf = gpd.GeoDataFrame(df, geometry=gpd.points_from_xy(df['Longitude'], df['Latitude']))
earth_radius = 6371.0
w_knn = KNN.from_dataframe(gdf, k=k, distance_metric='arc', radius=earth_radius)
w_knn.transform = 'R'
local_moran = Moran_Local(gdf[Value_Key], w_knn)

lm = local_moran.Is
0

There are 0 answers