acPCAtuneLambda: Tune the lambda parameter in function acPCA

Description Usage Arguments Value

View source: R/acPCAtuneLambda.R

Description

Tune the lambda parameter in function acPCA

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
acPCAtuneLambda(
  X,
  Y,
  nPC,
  lambdas,
  centerX = T,
  centerY = T,
  scaleX = F,
  scaleY = F,
  kernel = c("linear", "gaussian"),
  bandwidth = NULL,
  anov = T,
  perc = 0.05,
  quiet = F
)

Arguments

X

the n by p data matrix, where n is the number of samples, p is the number of variables. Missing values in X should be labeled as NA. If a whole sample in X is missing, it should be removed.

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.

nPC

number of principal components to compute.

lambdas

a vector with the tuning parameters, non-negative values. If 0 is not in lambdas, it will be added to lambdas.

centerX

center the columns in X. Default is True.

centerY

center the columns in Y. Default is True.

scaleX

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

scaleY

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

kernel

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

bandwidth

bandwidth h for Gaussian kernel. Optional.

anov

True or False. Whether the penalty term has the between groups sum of squares interpretation. Default is True.

perc

the best lambda is defined to be the smallest lambda with R(lambda)<=perc (if anov=T), or R(lambda)<=perc*R(lambda=0) (if anov=F) in the nPC principal components.

quiet

True or False. Output the progress of the program. Default is False.

Value

Results for tuning lambda

ratio

R(lambda): a vector with the ratios. Same length as lambdas

best_lambda

the best lambda after cross-validation

...

Input parameters for the function


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