-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- wrapper function over esda smaup - just tell user whether or not variable is affected by MAUP, if they want more info they should run it themselves for now - allow user to pass own regions and weights object in smaup_kwds - begin diagnostics module - only import warn from warnings
- Loading branch information
Showing
7 changed files
with
87 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,3 +19,4 @@ dependencies: | |
- mapclassify | ||
- descartes | ||
- joblib | ||
- esda |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ | |
from . import dasymetric | ||
from . import model | ||
from . import util | ||
from . import diagnostics |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from .smaup import _smaup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
""" | ||
A wrapper for using the S-maup statistical test in tobler interpolation | ||
""" | ||
|
||
from esda.smaup import Smaup | ||
from esda.moran import Moran | ||
|
||
def _smaup(k, y, w,): | ||
""" | ||
A function that wraps esda's smaup function and automates some of the process of calculating smaup. | ||
For more about smaup read here: https://pysal.org/esda/generated/esda.Smaup.html#esda.Smaup | ||
Parameters | ||
---------- | ||
k : int | ||
number of regions | ||
y : array | ||
data for autocorellation calculation | ||
w : libpysal.weights object | ||
pysal spatial weights object for autocorellation calculation | ||
Returns | ||
------- | ||
esda.smaup.Smaup: | ||
statistic that contains information regarding the extent to which the variable is affected by the MAUP. | ||
""" | ||
rho = Moran(y, w).I | ||
n = len(y) | ||
stat = Smaup(n,k,rho) | ||
return stat | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters