nbh.integer {RIPSeeker} | R Documentation

## HMM posterior decoding and NB parameter optimization

### Description

Inherithance function from `nbh` that receives a vector of integers and compute optimal HMM parameters via EM algorithm.

### Usage

    ## S3 method for class 'integer'
    nbh(x, K, NBM_NIT_MAX = 250,
    	NBM_TOL = 0.01, NBH_NIT_MAX = 250,
    	NBH_TOL = 0.001, runViterbi = FALSE, ...)

### Arguments

`x` | A vector of integers, conceptaully representing the read counts within bins of chromosome.
`K` | Number of hidden states.
`NBM_NIT_MAX` | Maximum number of EM iterations (Default: 250) for the negative binomial mixture model (NBM) intialization step (See `nbm_em`).
`NBM_TOL` | Threshold as fraction of increase in likelihood (given the current NBM parameters) comparing with the likelihood from the last iteration. EM for the NBM stops when the improvement is below the threshold (Default: 0.01).
`NBH_NIT_MAX` | Maximum number of EM iterations (Default: 250) for the negative binomial hidden Markov model (NBH).
`NBH_TOL` | Threshold as fraction of increase in likelihood (given the current NBH parameters) comparing with the likelihood from the last iteration. EM for the NBH stops when the improvement is below the threshold (Default: 0.001).
`runViterbi` | Binary indicator. If TRUE, Viterbi algorithm will be applied to derive the maximum likelihood hidden state sequence using the optimized HMM paramters obtained from the EM (See `nbh_em`).
`...` | Extra arguments are ignored.

### Details

The function consists of three major steps: (1) negarive binomail mixture model used to initialized HMM parameters; (2) optimization of HMM paramters using EM algorithm; (3) Viterbi maximum-liklihood estimation of hidden state sequence. Step (1) involves optimization of NBM parameters assuming the data points are independently sampled from a mixture of K NB distributions (See `nbh_init`). Given the optimized paramters for K-NBM, step (2) drops the independence assumption by introducing the transition probibility between hidden variables, which is initlaized as the mixing proportions of NBM (See `nbh_init`). Given the optimized HMM paramters, step (3) derives the maximum liklihood hidden state sequence using Viterbi algorithm. Step (3) is run only when runViterbi is TRUE.

### Value

A list containing:

`initAlpha` | Initialized alpha of NBM from `nbh_init`.
`initBeta` | Initialized beta of NBM from `nbh_init`.
`initTRANS` | Initialized mixing proportion of NBM from `nbh_init`.
`postprob` | Posteriors of the K hidden states for each observed count derived from `nbh_em` (e.g., posteriors of background and enriched state in a two-state HMM).
`alpha` | Optimized alpha of the NB mixture components in the HMM using `nbh_em`.
`TRANS` | Optimized transition probability of the HMM using `nbh_em`.
`viterbi_state` | Sequence of discrete values representing the hidden states derived from the maxmium likelihood estimation using Viterbi algorithm (See `nbh_vit`).

### Author(s)

Yue Li

### References

Rabiner, L. R. (1989). A tutorial on hidden Markov models and selected applications in speech recognition (Vol. 77, pp. 257-286). Presented at the Proceedings of the IEEE. doi:10.1109/5.18626

Bishop, Christopher. Pattern recognition and machine learning. Number 605-631 in Information Science and Statisitcs. Springer Science, 2006.

Capp\'e, O. (2001). H2M : A set of MATLAB/OCTAVE functions for the EM estimation of mixtures and hidden Markov models. (http://perso.telecom-paristech.fr/cappe/h2m/)

### See Also

`mainSeekSingleChrom, nbh, nbh.GRanges`

### Examples

    if(interactive()) ?nbh # see nbh for example of nbh running on integer object

[Package RIPSeeker version 1.24.0 Index]