Compute the spatial Laplacian matrix of a coordinate matrix
Source:R/spatial_weights.R
spatial_laplacian.RdThis function computes the spatial Laplacian matrix of a given coordinate matrix using specified parameters.
Arguments
- coord_mat
A numeric matrix representing coordinates
- dthresh
Numeric, the distance threshold for adjacency (default is 1.42)
- nnk
Integer, the number of nearest neighbors for adjacency (default is 27)
- weight_mode
Character, the mode for computing weights, either "binary" or "heat" (default is "binary")
- sigma
Numeric, the sigma parameter for the heat kernel (default is dthresh/2)
- normalized
Logical, whether the adjacency matrix should be normalized (default is TRUE)
- stochastic
Logical, whether the adjacency matrix should be stochastic (default is FALSE)
- handle_isolates
How to treat zero-degree nodes when normalizing: "self_loop" (default), "keep_zero", or "drop".