Compute the spatial smoother matrix for a coordinate matrix
Source:R/spatial_weights.R
spatial_smoother.RdThis function computes the spatial smoother matrix for a given coordinate matrix using specified parameters.
Arguments
- coord_mat
A numeric matrix representing coordinates
- sigma
Numeric, the sigma parameter for the Gaussian smoother (default is 5)
- nnk
Integer, the number of nearest neighbors for adjacency (default is 3^(ncol(coord_mat)))
- stochastic
Logical, whether the adjacency matrix should be doubly stochastic (default is TRUE)
- handle_isolates
How to treat zero-degree nodes when normalizing: "self_loop" adds a self-loop (default), "keep_zero" leaves them as zero, or "drop" removes them from the matrix.