estimate_sigma: Estimate Bandwidth Parameter (Sigma) for the Heat Kernel

View source: R/knn_weights.R

estimate_sigmaR Documentation

Estimate Bandwidth Parameter (Sigma) for the Heat Kernel

Description

Estimate a reasonable bandwidth parameter (sigma) for the heat kernel based on a data matrix and the specified quantile of the frequency distribution of distances.

Usage

estimate_sigma(X, prop = 0.25, nsamples = 500, normalized = FALSE)

Arguments

X

A data matrix where samples are rows and features are columns.

prop

A numeric value representing the quantile of the frequency distribution of distances used to determine the bandwidth parameter. Default is 0.25.

nsamples

An integer representing the number of samples to draw from the data matrix. Default is 500.

normalized

A logical value indicating whether to normalize the data. Default is FALSE.

Value

A numeric value representing the estimated bandwidth parameter (sigma) for the heat kernel.

Examples

# Sample data
X <- matrix(rnorm(1000), nrow=100, ncol=10)

# Estimate sigma with default parameters
sigma_default <- estimate_sigma(X)

# Estimate sigma with custom quantile and number of samples
sigma_custom <- estimate_sigma(X, prop=0.3, nsamples=300)

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