pysal.explore.esda.
Join_Counts
(y, w, permutations=999)[source]¶Binary Join Counts
Parameters: |
|
---|
Notes
Technical details and derivations can be found in [CO81].
Examples
Replicate example from anselin and rey
>>> import numpy as np
>>> import pysal.lib
>>> w = pysal.lib.weights.lat2W(4, 4)
>>> y = np.ones(16)
>>> y[0:8] = 0
>>> np.random.seed(12345)
>>> from pysal.explore.esda.join_counts import Join_Counts
>>> jc = Join_Counts(y, w)
>>> jc.bb
10.0
>>> jc.bw
4.0
>>> jc.ww
10.0
>>> jc.J
24.0
>>> len(jc.sim_bb)
999
>>> round(jc.p_sim_bb, 3)
0.003
>>> round(np.mean(jc.sim_bb), 3)
5.547
>>> np.max(jc.sim_bb)
10.0
>>> np.min(jc.sim_bb)
0.0
>>> len(jc.sim_bw)
999
>>> jc.p_sim_bw
1.0
>>> np.mean(jc.sim_bw)
12.811811811811811
>>> np.max(jc.sim_bw)
24.0
>>> np.min(jc.sim_bw)
7.0
>>>
Attributes: |
|
---|
Methods
by_col (df, cols[, w, inplace, pvalue, outvals]) |
Function to compute a Join_Count statistic on a dataframe |
__init__
(y, w, permutations=999)[source]¶Initialize self. See help(type(self)) for accurate signature.
Methods
__init__ (y, w[, permutations]) |
Initialize self. |
by_col (df, cols[, w, inplace, pvalue, outvals]) |
Function to compute a Join_Count statistic on a dataframe |