cv.emeth: cv.emeth: cross validation for emeth.

Description Usage Arguments Value Author(s) Examples

View source: R/cv.emeth.R

Description

An implementation of cross validation for the ridge penalty parameter in EMeth.

Usage

1
cv.emeth(Y, eta, mu, aber, V, init = "default", nu, family = "laplace", folds = 5, usesubset = TRUE, maxiter = 50, verbose = FALSE)

Arguments

Y

Matrix of size K*I. Methylation of bulk sample for which the cell type decomposition is to be estimated. Y is usually a K*I matrix where K is the number of probes used and I is the number of samples.

eta

Vector of size I. Tumor purity of each sample.

mu

Matrix of size K*Q. Reference matrix, provided by literature. A sample reference data of immune cells is provided in the example directory.

aber

Logic variable: if there is unknown aberrant cell type.

V

string: default to be 'c' which stands for constant weight for all probes. It might be 'b' for binomial variance structure or 'w' for specific weight structure of variance.

init

If init is a string 'default', we will adopt the default random initialization of all parameters for the algorithm. Otherwise one can provide a list of initialization of parameters.

family

string: accept 'normal' or 'laplace' to specify what likelihood will be used in the algorithm.

nu

nonnegative numbers that stand for the penalties, and the opitmal penalty value will be chosen by cross-validation.

folds

Specify the number of folds for the cross validation.

usesubset

Logic variable, if it is true, a random sampled subset of all probes are used to perform cross-validation.

maxiter

max time of iteration of the EM algorithm, default to be 50.

verbose

logic variable. If TRUE then will print additional information in iteration of EMeth.

Value

result

The result of EMeth algorithm using the penalty value selected by cross-validation. It is a list and documentation of its entries can be found in the help file for function emeth

choosenu

The chosen value of nu, the penalty.

losslist

A matrix saving the loss for each fold and each choice of nu.

Author(s)

Hanyu Zhang

Examples

1
## See examples folder.

Hanyuz1996/EMeth documentation built on Dec. 31, 2020, 12:59 p.m.