esda.Join_Counts¶
-
class esda.Join_Counts(y, w, permutations=
999, drop_islands=True)[source]¶ Binary Join Counts
- Parameters:¶
- p_sim_bb[source]¶
- (if permutations>0)
p-value based on permutations (one-sided) null: spatial randomness alternative: the observed bb is greater than under randomness
- Type:¶
array
- p_sim_bw[source]¶
(if permutations>0) p-value based on permutations (one-sided) null: spatial randomness alternative: the observed bw is greater than under randomness
- Type:¶
array
- drop_islands[source]¶
Whether or not to preserve islands as entries in the adjacency list. By default, observations with no neighbors do not appear in the adjacency list. If islands are kept, they are coded as self-neighbors with zero weight. See
libpysal.weights.to_adjlist().
Examples
>>> import numpy as np >>> import libpysal >>> w = libpysal.weights.lat2W(4, 4) >>> y = np.ones(16) >>> y[0:8] = 0 >>> np.random.seed(12345) >>> from esda import Join_Counts >>> jc = Join_Counts(y, w) >>> jc.bb np.float64(10.0) >>> jc.bw np.float64(4.0) >>> jc.ww np.float64(10.0) >>> jc.J np.float64(24.0) >>> len(jc.sim_bb) 999 >>> round(jc.p_sim_bb, 3) np.float64(0.003) >>> round(np.mean(jc.sim_bb), 3) np.float64(5.547) >>> np.max(jc.sim_bb) np.float64(10.0) >>> np.min(jc.sim_bb) np.float64(0.0) >>> len(jc.sim_bw) 999 >>> jc.p_sim_bw np.float64(1.0) >>> np.mean(jc.sim_bw) np.float64(12.811811811811811) >>> np.max(jc.sim_bw) np.float64(24.0) >>> np.min(jc.sim_bw) np.float64(7.0) >>> round(jc.chi2_p, 3) np.float64(0.004) >>> jc.p_sim_chi2 np.float64(0.008)Notes
Technical details and derivations can be found in [Cliff and Ord, 1981].