# controlEM: Control parameters of the EM algorithm from mixNBHMM In plbaldoni/mixNBHMM: Differential Peak Calling via Hidden Markov Model With Mixture of Negative Binomial Distributions

## Description

This function passes controlling parameters for mixNBHMM. Most of these parameters control the EM algorithm.

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16``` ```controlEM( epsilon.em = c(1e-04, 1e-04, 1e-06, 1e-04), maxit.em = 500, minit.em = 3, gap.em = 3, maxcount.em = 3, max.phi = 1000, criterion = "MULTI", min.zero = .Machine\$double.xmin, pcut = 0.05, quiet = T, maxit.innerem = 5, epsilon.innerem = 0.001, trim.offset = 3, pattern = "all" ) ```

## Arguments

 `epsilon.em` Either a positive value or a vector of size 4 with the convergence tolerance values for the EM algorithm (see 'criterion' below). Default is c(1e-3,1e-3,1e-6,1e-3) `maxit.em` integer giving the maximum number of EM iterations (default 500) `minit.em` integer giving the minimum number of EM iterations to start evaluating the convergence (default 3) `gap.em` integer giving the number of EM iterations apart to compute the convergence criterion (default 3) `maxcount.em` integer giving the number of consecutive EM iterations satisfying the convergence criterion in order to stop the algorithm (default 3) `max.phi` maximum positive value allowed for the dispersion parameters (default 1000) `criterion` convergence criterion: either "MRCPE" (maximum absolute relative change in parameter estimates), "MACPE" (maximum absolute change of parameter estimates), "ARCEL" (absolute relative change of the Q-function), "ACC" (agreement of Viterbi peak calls), or "MULTI" (simultaneously check for MRCPE, MACPE, ARCEL, and ACC). For ACC, it computes the percentage of windows falling in the main diagonal of a 3 by 3 table of Viterbi predictions 'gap.em' iterations apart. Default is "MULTI" `min.zero` minimum positive value allowed in computations to avoid having zeros (default is .Machine\$double.xmin) `pcut` cutoff for rejection controlled EM algorithm (default 0.05) `quiet` whether to print messages (default F) `maxit.innerem` integer giving the maximum number of inner EM iterations (default 5) `epsilon.innerem` a positive value with the convergence tolerance value for the inner EM algorithm. The criterion for the inner EM is "MRCPE". `trim.offset` either NULL or an integer indicating the number of decimal places to be used in the offset (default 3) `pattern` either 'all', 'cluster', or a list with length equal to the number of differential patterns to be modeled by the differential HMM state. If 'all', every possible combinatorial pattern will be considered. If 'cluster', the algorithm will determine the number of mixture components based on the number of most representative combinatorial patterns while discarding patterns whose prevalence is less than 0.05. If a list, elements of it should specify the differential patterns to be modeled by each mixture component. For instance, if pattern = list(2,c(1,3)) the mixture model will have two components that will represent the enrichment of condition 2 alone and the enrichment of conditions 1 and 3 together.

## Value

A list with components equal to the arguments

## Author(s)

Pedro L. Baldoni, [email protected]

## Examples

 ```1 2``` ```# Setting maxit.em = 100 (no more than 100 EM iterations) control = controlEM(maxit.em = 100) ```

plbaldoni/mixNBHMM documentation built on Dec. 24, 2019, 1:31 p.m.