Calculating Local Moran's I

869
4
05-24-2021 03:02 AM
Peer
by
New Contributor

Hi!

I am trying to understand the calculations behind Local Moran's I and I was wondering how the mean (X bar) was calculated. I think I understand the consept of neighbourhood and the weight matrix, W, but what the corresponding attributes mean is not clear to me. Do you include the value of i in the mean or du you leav it out of the equation?

Any help would be great, thanks!

Peer_0-1621850044045.png

 

0 Kudos
4 Replies
LaurenGriffin
Esri Contributor

X bar is just the mean. If you are running Local Moran's I on a variable X, then X bar is the mean for all X values. I don't remember if the mean is computed as sum of all X values divided by N or the sum of all X values divided by N-1, though. If you locate the tool in the system toolbox, you can right click on it and select Edit to see the tool code. 

I hope this helps!

Best wishes,

Lauren

0 Kudos
JoshG
by
New Contributor II

Hi Lauren - I tried right clicking on the tool and selected Edit but I got a pop-up box that says the Script File is empty. Is there any other way to view the tool code?

0 Kudos
LaurenGriffin
Esri Contributor

What version of the software are you using? (It shouldn't matter, but I can try to reproduce what you're seeing). This is what I'm seeing:

LaurenGriffin_0-1674764324000.png

In the Geoprocessing pane, I select Toolboxes. In The Spatial Statistics toolbox under Mapping Clusters, I right click on the Cluster and Outlier Analysis tool, select Edit, and up pops the script.

Another way to find it is to navigate to: <your ArcGIS folder, where ever you installed the software... like maybe in ProgramFiles\ArcGIS> then navigate to: \Pro\Resources\ArcToolBox\Scripts and view the LocalMorans.py python script file. For example, you should be able to right click that file and choose open with <Notepad or Wordpad, for example>

I hope this works for you!

Best wishes,

Lauren

 

0 Kudos
JoshG
by
New Contributor II

Hi Lauren, thank you for the instructions, they worked! I was trying to find the tool by searching the tool box instead of accessing it in the way you suggested.