nmfkc.kernel.beta.nearest.med estimates the Gaussian kernel
parameter \(\beta\) by computing the median of nearest-neighbor
distances among covariates. This is useful for setting the scale
parameter in kernel-based NMF with covariates.
Value
A list with components:
- beta
estimated kernel parameter \(\beta=1/(2 d_{med}^2)\)
- beta_candidates
a numeric vector of candidate values obtained by multiplying the estimate \(\beta\) by powers of 10, i.e.\ \(\{\beta \cdot 10^{-2},\,\beta \cdot 10^{-1},\,\beta,\,\beta \cdot 10^{1}\}\)
- dist_median
the median nearest-neighbor distance
- block_size_used
actual block size used in computation
Details
The function computes all pairwise squared distances between columns of \(U\), excludes self-distances, and takes the median of the nearest-neighbor distances (after square root). This median is then used to set \(\beta\).