cross_weighted_spatial_adjacency: Compute the adjacency between two adjacency matrices weighted...

View source: R/spatial_weights.R

cross_weighted_spatial_adjacencyR Documentation

Compute the adjacency between two adjacency matrices weighted by two corresponding feature matrices.

Description

Compute the adjacency between two adjacency matrices weighted by two corresponding feature matrices.

Usage

cross_weighted_spatial_adjacency(
  coord_mat1,
  coord_mat2,
  feature_mat1,
  feature_mat2,
  wsigma = 0.73,
  alpha = 0.5,
  nnk = 27,
  maxk = nnk,
  weight_mode = c("binary", "heat"),
  sigma = 1,
  dthresh = sigma * 2.5,
  normalized = TRUE
)

Arguments

coord_mat1

the first coordinate matrix (the query)

coord_mat2

the second coordinate matrix (the reference)

feature_mat1

the first feature matrix

feature_mat2

the second feature matrix

wsigma

the sigma for the feature heat kernel

alpha

the mixing weight for the spatial distance (1=all spatial weighting, 0=all feature weighting)

nnk

the maximum number of spatial nearest neighbors to include

maxk

the maximum number of neighbors to include within spatial window

dthresh

the threshold for the spatial distance

normalized

whether to normalize the rows to sum to 1

Examples


coords <- as.matrix(expand.grid(1:5, 1:5))
fmat1 <- matrix(rnorm(5*25), 25, 5)
fmat2 <- matrix(rnorm(5*25), 25, 5)

adj <- cross_weighted_spatial_adjacency(coords, coords, fmat1, fmat2)

bbuchsbaum/graphweights documentation built on April 4, 2024, 7:19 p.m.