Skip to content

Commit

Permalink
add checks, add docs to crand-using classes
Browse files Browse the repository at this point in the history
  • Loading branch information
ljwolf committed Aug 15, 2024
1 parent 6e712bb commit 08a55f5
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 25 deletions.
11 changes: 9 additions & 2 deletions esda/crand.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,15 @@ def crand(
Spatial weights object
observed : ndarray
(N,) array with observed values
permutations : int
Number of permutations for conditional randomisation
permutations : int, np.ndarray
Number of permutations for conditional randomisation, or the permutation array itself. Providing an integer will test the
conditional random null hypothesis for each site. Permutations
might be specified as an array of indices if the user needs to add
structure to this conditional permutation null hypothesis. Common
reasons to do this include exchangeability violations, which might
then require us to shuffle observations within (but not between)
groups, or linearity constraints, which may require certain
sequences of observation relationships to be preserved.
keep : Boolean
If True, store simulation; else do not return randomised statistics
n_jobs : int
Expand Down
13 changes: 9 additions & 4 deletions esda/geary_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,15 @@ def __init__(
(default=0.05)
Default significance threshold used for
creation of labels groups.
permutations : int
(default=999)
number of random permutations for calculation
of pseudo p_values
permutations : int, np.ndarray
Number of permutations for conditional randomisation, or the permutation array itself. Providing an integer will test the
conditional random null hypothesis for each site. Permutations
might be specified as an array of indices if the user needs to add
structure to this conditional permutation null hypothesis. Common
reasons to do this include exchangeability violations, which might
then require us to shuffle observations within (but not between)
groups, or linearity constraints, which may require certain
sequences of observation relationships to be preserved.
n_jobs : int
(default=1)
Number of cores to be used in the conditional
Expand Down
12 changes: 9 additions & 3 deletions esda/getisord.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,15 @@ class G_Local: # noqa: N801
spatial weights instance as W or Graph aligned with y
transform : {'R', 'B'}
the type of w, either 'B' (binary) or 'R' (row-standardized)
permutations : int
the number of random permutations for calculating
pseudo p values
permutations : int, np.ndarray
Number of permutations for conditional randomisation, or the permutation array itself. Providing an integer will test the
conditional random null hypothesis for each site. Permutations
might be specified as an array of indices if the user needs to add
structure to this conditional permutation null hypothesis. Common
reasons to do this include exchangeability violations, which might
then require us to shuffle observations within (but not between)
groups, or linearity constraints, which may require certain
sequences of observation relationships to be preserved.
star : boolean or float
whether or not to include focal observation in sums (default: False)
if the row-transformed weight is provided, then this is the default
Expand Down
12 changes: 9 additions & 3 deletions esda/join_counts_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,15 @@ def __init__(
----------
connectivity : W | Graph
spatial weights instance as W or Graph aligned with y
permutations : int
number of random permutations for calculation of pseudo
p_values
permutations : int, np.ndarray
Number of permutations for conditional randomisation, or the permutation array itself. Providing an integer will test the
conditional random null hypothesis for each site. Permutations
might be specified as an array of indices if the user needs to add
structure to this conditional permutation null hypothesis. Common
reasons to do this include exchangeability violations, which might
then require us to shuffle observations within (but not between)
groups, or linearity constraints, which may require certain
sequences of observation relationships to be preserved.
n_jobs : int
Number of cores to be used in the conditional randomisation. If -1,
all available cores are used.
Expand Down
11 changes: 9 additions & 2 deletions esda/join_counts_local_bv.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ def __init__(
----------
connectivity : W | Graph
spatial weights instance as W or Graph aligned with y
permutations : int
number of random permutations for calculation of pseudo p_values
permutations : int, np.ndarray
Number of permutations for conditional randomisation, or the permutation array itself. Providing an integer will test the
conditional random null hypothesis for each site. Permutations
might be specified as an array of indices if the user needs to add
structure to this conditional permutation null hypothesis. Common
reasons to do this include exchangeability violations, which might
then require us to shuffle observations within (but not between)
groups, or linearity constraints, which may require certain
sequences of observation relationships to be preserved.
n_jobs : int
Number of cores to be used in the conditional randomisation.
If -1, all available cores are used.
Expand Down
11 changes: 9 additions & 2 deletions esda/join_counts_local_mv.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,15 @@ def __init__(
----------
connectivity : W | Graph
spatial weights instance as W or Graph aligned with y
permutations : int
number of random permutations for calculation of pseudo p_values
permutations : int, np.ndarray
Number of permutations for conditional randomisation, or the permutation array itself. Providing an integer will test the
conditional random null hypothesis for each site. Permutations
might be specified as an array of indices if the user needs to add
structure to this conditional permutation null hypothesis. Common
reasons to do this include exchangeability violations, which might
then require us to shuffle observations within (but not between)
groups, or linearity constraints, which may require certain
sequences of observation relationships to be preserved.
n_jobs : int
Number of cores to be used in the conditional randomisation. If -1,
all available cores are used.
Expand Down
36 changes: 27 additions & 9 deletions esda/moran.py
Original file line number Diff line number Diff line change
Expand Up @@ -891,9 +891,15 @@ class Moran_Local: # noqa: N801
"D": doubly-standardized,
"U": untransformed (general weights),
"V": variance-stabilizing.
permutations : int
number of random permutations for calculation of pseudo
p_values
permutations : int, np.ndarray
Number of permutations for conditional randomisation, or the permutation array itself. Providing an integer will test the
conditional random null hypothesis for each site. Permutations
might be specified as an array of indices if the user needs to add
structure to this conditional permutation null hypothesis. Common
reasons to do this include exchangeability violations, which might
then require us to shuffle observations within (but not between)
groups, or linearity constraints, which may require certain
sequences of observation relationships to be preserved.
geoda_quads : boolean
(default=False)
If True use GeoDa scheme: HH=1, LL=2, LH=3, HL=4
Expand Down Expand Up @@ -1265,9 +1271,15 @@ class Moran_Local_BV: # noqa: N801
"D": doubly-standardized,
"U": untransformed (general weights),
"V": variance-stabilizing.
permutations : int
number of random permutations for calculation of pseudo
p_values
permutations : int, np.ndarray
Number of permutations for conditional randomisation, or the permutation array itself. Providing an integer will test the
conditional random null hypothesis for each site. Permutations
might be specified as an array of indices if the user needs to add
structure to this conditional permutation null hypothesis. Common
reasons to do this include exchangeability violations, which might
then require us to shuffle observations within (but not between)
groups, or linearity constraints, which may require certain
sequences of observation relationships to be preserved.
geoda_quads : boolean
(default=False)
If True use GeoDa scheme: HH=1, LL=2, LH=3, HL=4
Expand Down Expand Up @@ -1536,9 +1548,15 @@ class Moran_Local_Rate(Moran_Local): # noqa: N801
"D": doubly-standardized,
"U": untransformed (general weights),
"V": variance-stabilizing.
permutations : int
number of random permutations for calculation of pseudo
p_values
permutations : int, np.ndarray
Number of permutations for conditional randomisation, or the permutation array itself. Providing an integer will test the
conditional random null hypothesis for each site. Permutations
might be specified as an array of indices if the user needs to add
structure to this conditional permutation null hypothesis. Common
reasons to do this include exchangeability violations, which might
then require us to shuffle observations within (but not between)
groups, or linearity constraints, which may require certain
sequences of observation relationships to be preserved.
geoda_quads : boolean
(default=False)
If True use GeoDa scheme: HH=1, LL=2, LH=3, HL=4
Expand Down

0 comments on commit 08a55f5

Please sign in to comment.