calkernel: Calculate the kernel matrix

Description Usage Arguments Value Examples

View source: R/calkernel.R

Description

Calculate the kernel matrix

Usage

1
calkernel(Y, kernel, bandwidth, scaleY = F)

Arguments

Y

the n by q confounder matrix, where n is the number of samples, q is the number of confounding factors. Missing values in Y should be labeled as NA.

kernel

the kernel to use: "linear", "gaussian".

bandwidth

bandwidth h for Gaussian kernel. Optional.

scaleY

scale the columns in Y to unit standard deviation. Default is False.

Value

The kernel matrix

K

the n by n kernel matrix for Y

Examples

1
2
3
Y <- data_tree$ConfounderMat
K1 <- calkernel(Y, kernel="linear") ##linear kernel
K2 <- calkernel(Y, kernel="gaussian", bandwidth=1) ##Gaussian kernel

YuWang28/acPCoA documentation built on Dec. 18, 2021, 8:20 p.m.