SpatialPCA_buildKernel: Calculating kernel matrix from spatial locations.

View source: R/SpatialPCA_buildKernel.R

SpatialPCA_buildKernelR Documentation

Calculating kernel matrix from spatial locations.

Description

Calculating kernel matrix from spatial locations.

Usage

SpatialPCA_buildKernel(
  object,
  kerneltype = "gaussian",
  bandwidthtype = "SJ",
  bandwidth.set.by.user = NULL,
  sparseKernel = FALSE,
  sparseKernel_tol = 1e-20,
  sparseKernel_ncore = 1
)

Arguments

object

SpatialPCA object.

kerneltype

The type of kernel to be used, either "gaussian", or "cauchy" for cauchy kernel, or "quadratic" for rational quadratic kernel, and "delaunday" for gaussian kernel built with non-linear Delaunay triangulation based distance.

bandwidthtype

The type of bandwidth to be used in Gaussian kernel, "SJ" for Sheather & Jones (1991) method (usually used in small size datasets), "Silverman" for Silverman's ‘rule of thumb’ method (1986)(usually used in large size datasets).

bandwidth.set.by.user

User could select their own bandwidth (a numeric value) if the recommended bandwidth doesn't work in their dataset.

sparseKernel

Select "TURE" if the user wants to use a sparse kernel matrix or "FALSE" if not. It is recommended to choose sparseKernel="TRUE" when sample size is large.

sparseKernel_tol

When sparseKernel=TRUE, the cut-off value when building sparse kernel matrix, any element in the kernel matrix greater than sparseKernel_tol will be kept, otherwise will be set to 0 to save memory.

sparseKernel_ncore

When sparseKernel=TRUE, the number of CPU cores to build sparse kernel matrix.


shangll123/SpatialPCA documentation built on April 17, 2024, 3:15 a.m.