spacenet.pcf.helpers.compute_weighted_contributions#
- spacenet.pcf.helpers.compute_weighted_contributions(object_id_A, object_indices_B, r, spatial_kernel_bandwidth, spatial_kernel_n, total_length, this_node_shortest_distance, these_marker_contributions_weighting, node_to_edges)#
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.
- Parameters:
- object_id_Anp.array, int
The ID of the reference node for which local contributions are being computed.
- object_indices_Bnp.array
An array of node indices corresponding to the population B for which the pair correlation function is being computed.
- rnp.array
An array of radii at which to compute the contributions.
- spatial_kernel_bandwidthfloat
The bandwidth parameter for the spatial kernel function.
- spatial_kernel_nfloat
The exponent parameter for the spatial kernel function.
- total_lengthfloat
The total length of the network, used for density normalization.
- this_node_shortest_distancedict
A dictionary mapping node indices to their shortest distance from the reference node (object_id_A). This should be precomputed for efficiency.
- these_marker_contributions_weightingnp.array
An array of shape (num_objects_B, num_markers) containing the contributions of each object in population B to each marker. This should be precomputed based on the marker values and the weighting scheme for the contributions.
- node_to_edgesdict
A dictionary mapping node indices to a list of edges (and their weights) that are connected to that node. This should be precomputed for efficiency.
- Returns:
- local_contributionsnp.array
An array of local contributions to the pair correlation function for the reference node at each radius in r, weighted by the marker contributions. The shape of this array will be (num_markers, len(r)).