View source: R/spatial_weights.R
difference_of_gauss | R Documentation |
This function computes the Difference of Gaussians for a given coordinate matrix using specified sigma values and the number of nearest neighbors.
difference_of_gauss(
coord_mat,
sigma1 = 2,
sigma2 = sigma1 * 1.6,
nnk = 3^(ncol(coord_mat))
)
coord_mat |
A numeric matrix representing coordinates |
sigma1 |
Numeric, the first sigma parameter for the Gaussian smoother (default is 2) |
sigma2 |
Numeric, the second sigma parameter for the Gaussian smoother (default is sigma1 * 1.6) |
nnk |
Integer, the number of nearest neighbors for adjacency (default is 3^(ncol(coord_mat))) |
A sparse symmetric matrix representing the computed Difference of Gaussians
# Create an example coordinate matrix
coord_mat <- matrix(c(1, 2, 3, 4, 5, 6), nrow = 3, ncol = 2)
# Compute the Difference of Gaussians with sigma1 = 2 and sigma2 = 3.2
result <- difference_of_gauss(coord_mat, sigma1 = 2, sigma2 = 3.2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.