pygeoda.local_bijoincount

pygeoda.local_bijoincount(w, data, **kwargs)[source]

Bivariate Local Join Count Statistics

The function to apply (no-colocation) bivariate local Join Count statistics. The bivariate local join count only applies on two variables with no-colocation.

Parameters
  • w (Weight) – An instance of Weight class

  • data (list or dataframe) – A list of numeric vectors of selected variable or a data frame of selected variables e.g. guerry[[‘Crm_prs’, ‘Literacy’]]

  • permutations (int, optional) – The number of permutations for the LISA computation

  • permutation_method (str, optional) – The permutation method used for the LISA computation. Options are {‘complete’, ‘lookup-table’}. Default is ‘complete’.

  • significance_cutoff (float, optional) – A cutoff value for significance p-values to filter not-significant clusters

  • cpu_threads (int, optional) – The number of cpu threads used for parallel LISA computation

  • seed (int, optional) – The seed for random number generator

Returns

An instance of lisa class

Return type

lisa

Examples

>>> import pygeoda
>>> columbus = pygeoda.open("./data/columbus.shp")
>>> columbus_q = pygeoda.queen_weights(columbus)
>>> nsa = columbus.GetRealCol("nsa")
>>> nsa_inv = [1-i for i in nsa]
>>> lisa = pygeoda.local_bijoincount(columbus_q, [nsa, nsa_inv])
>>> jc = lisa.lisa_values()
(0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 2.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 3.0, 3.0, 2.0, 0.0, 0.0, 0.0, 0.0, 3.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0)
>>> pvals = lisa.lisa_pvalues()
(nan, nan, nan, nan, nan, nan, nan, nan, 0.002, 0.034, nan, nan, nan, nan, nan, nan, 0.44, nan, nan, nan, nan, 0.262, nan, 0.125, 0.079, 0.053, nan, nan, nan, nan, 0.093, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan)
>>> nn = lisa.lisa_num_nbrs()
(2, 3, 4, 4, 8, 2, 4, 6, 8, 4, 5, 6, 4, 6, 6, 8, 3, 4, 3, 10, 3, 6, 3, 7, 8, 6, 4, 9, 7, 5, 3, 4, 4, 4, 7, 5, 6, 6, 3, 5, 3, 2, 6, 5, 4, 2, 2, 4, 3)