difference_of_gauss: Compute the Difference of Gaussians for a coordinate matrix

View source: R/spatial_weights.R

difference_of_gaussR Documentation

Compute the Difference of Gaussians for a coordinate matrix

Description

This function computes the Difference of Gaussians for a given coordinate matrix using specified sigma values and the number of nearest neighbors.

Usage

difference_of_gauss(
  coord_mat,
  sigma1 = 2,
  sigma2 = sigma1 * 1.6,
  nnk = 3^(ncol(coord_mat))
)

Arguments

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)))

Value

A sparse symmetric matrix representing the computed Difference of Gaussians

Examples

# 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)


bbuchsbaum/neighborweights documentation built on April 1, 2024, 8:41 p.m.