spacenet.point_patterns#

Pair correlation functions#

cross_pair_correlation_function

Computes the pair correlation function (PCF) or cross-pair correlation function (cross-PCF) for nodes in a spatial network.

weighted_pair_correlation_function

Computes the weighted pair correlation function between two populations of nodes.

cross_weighted_pair_correlation_function

Compute the cross weighted pair correlation function between two populations of objects (A and B) on a spatial network, where the contributions of each object to the pair correlation function are weighted by a kernel function based on their marker levels.

Correlation helper functions#

helpers.spatial_bootstrap

Compute the 95% confidence interval for the pair correlation function at each radius (and target marker, if applicable) using method of spatial bootstrap on spatial networks.

helpers.polynomial_kernel

Computes the polynomial kernel function for a given distance or array of distances.

helpers.integrated_poly_finite_kernel

Computes the integrated polynomial kernel function for given distances and bandwidth parameters.

helpers.is_connected_filter

A helper function to check if the network is connected and filter to the largest connected component if not.

helpers.compute_contributions

Computes the local contributions to the pair correlation function for a given reference node (object_id_A) and a set of target nodes (object_indices_B) at specified radii (r).

helpers.compute_weighted_contributions

Compute the local contributions to the pair correlation function for a given reference node (object_id_A) and a set of target nodes (object_indices_B) at specified radii (r), weighted by marker contributions.

helpers.compute_contributions_parallel

Runs the compute_contributions function in parallel across multiple CPU cores for a list of object indices.

helpers.compute_weighted_contributions_parallel

Computes the local contributions to the pair correlation function for a list of reference nodes (object_indices_A) and a set of target nodes (object_indices_B) at specified radii (r), weighted by marker contributions, in parallel across multiple CPU cores.