Skip to content

Commit

Permalink
summarize
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfleis committed Jul 16, 2024
1 parent 5ba5327 commit a05b5b8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions esda/getisord.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def __init__(self, y, w, permutations=PERMUTATIONS):
w.transform = "B"
else:
w = w.transform("B")
self.summary = w.summary()
self.w = w
self.permutations = permutations
self.__moments()
Expand Down Expand Up @@ -153,11 +154,11 @@ def __moments(self):
n = self.n
w = self.w
n2 = n * n
s0 = w.s0
s0 = w.s0 if isinstance(w, W) else self.summary.s0
self.EG = s0 / (n * (n - 1))
s02 = s0 * s0
s1 = w.s1
s2 = w.s2
s1 = w.s1 if isinstance(w, W) else self.summary.s1
s2 = w.s2 if isinstance(w, W) else self.summary.s2
b0 = (n2 - 3 * n + 3) * s1 - n * s2 + 3 * s02
b1 = (-1.0) * ((n2 - n) * s1 - 2 * n * s2 + 6 * s02)
b2 = (-1.0) * (2 * n * s1 - (n + 3) * s2 + 6 * s02)
Expand Down

0 comments on commit a05b5b8

Please sign in to comment.